Some of the secret doors carry a very interesting word puzzle. The team of archaeologists must solve it to open those doors. Because there is no other way to open the doors, the puzzle is very important to us.
Every door is covered with a large number of magnetic plates, and each plate has a single word written on it. The plates must be arranged into a sequence so that every word begins with the same letter that the previous word ends with. For example, the word ac*m* can be followed by the word *m*otorola. Write a program that reads the list of words and determines whether it is possible to arrange all of the plates into one sequence (following the rule above) and thus open the door.
The input consists of $T$ test cases. The first line gives the number of test cases $T$. Each test case begins with a line containing a single integer $N$, the number of plates ($1 \le N \le 100000$). Exactly $N$ lines follow, each containing a single word. Each word is at least 2 and at most 1000 lowercase characters long, using only the letters a through z. The same word may appear several times in the list.
For each test case, determine whether all the plates can be arranged into a sequence in which the first letter of each word equals the last letter of the previous word. Every plate from the list must be used exactly once, and a word listed several times must be used that many times.
If such an ordering exists, print Ordering is possible.; otherwise, print The door cannot be opened.