Hide

Problem F
Non-boring sequences

We were afraid of making this problem statement too boring, so we decided to keep it short. A sequence is called non-boring if its every connected subsequence contains a unique element, i.e. an element such that no other element of that subsequence has the same value. Given a sequence of integers, decide whether it is non-boring.

Input

The first line of the input contains the number of test cases $T$, where $1 \le T \le 100\, 000$. The descriptions of the test cases follow:

Each test case starts with an integer $n$ ($1 \leq n \leq 200\, 000$) denoting the length of the sequence. In the next line the $n$ elements of the sequence follow, separated with single spaces. The elements are non-negative integers less than $10^9$. The sum of $n$ over all $T$ test cases is at most $1\, 500\, 000$.

Output

Print the answers to the test cases in the order in which they appear in the input. For each test case print a single line containing the word non-boring or boring.

Sample Input 1 Sample Output 1
4
5
1 2 3 4 5
5
1 1 1 1 1
5
1 2 3 2 1
5
1 1 2 1 1
non-boring
boring
non-boring
boring

Please log in to submit a solution to this problem

Log in