Equal Is Not Really Equal

No attempts yetTime limit1sMemory limit128 MB

Problem

Many programming languages provide a standard function to test whether two strings are equal, and even without one it is easy: just compare the characters at each corresponding position.

Sometimes, however, a plain yes/no answer is not enough. When two strings are not exactly equal but differ only slightly, we would like a measure of how close they are. Simply counting how many positions hold the same character (relative to the length) is unsatisfactory. For example, the strings "ABCDEFABCDEF" and "BCDEFABCDEFA" are almost the same and have equal length, yet every position holds a different character.

A better measure looks at pairs of consecutive characters. For instance, "ABCDEFABCDEF" contains eleven consecutive pairs: two "AB", two "BC", two "CD", two "DE", two "EF", and one "FA". Ten of these pairs also appear in "BCDEFABCDEFA"; only one "AB" is replaced by an "FA". So we could say the two strings are $10/11 \approx 91%$ equal, which seems reasonable. This measure extends naturally to strings of different lengths.

This measure has one drawback: if two equally long strings are $100%$ equal under it, they need not be identical. For example, both "ABACA" and "ACABA" contain exactly one "AC", one "CA", one "AB", and one "BA".

We now ask whether this can happen for an arbitrary string. Given a string $x$, does there exist a different string $y$ of the same length whose multiset of consecutive character pairs is identical (measure of equality $100%$)? If such a $y$ exists we call $x$ not unique; otherwise we call $x$ unique.

Input

The first line contains a single integer: the number of test cases that follow. Each test case is one line containing a string $x$ with $1 \le |x| \le 10000$, consisting only of uppercase letters from the alphabet ${A, B, C, \dots, Z}$.

Output

For each test case, output a single line containing "unique" if the string $x$ is unique, and "not unique" otherwise.