Halvor runs the single sign-on (SSO) login system at Identity Directories, Inc. For years he has told anyone who would listen that the encrypted login backend from Trustworthy Enterprises (TE) makes user authentication simpler and safer. Last week TE sent out a newsletter about their new Open Trust Protection (OTP) system. OTP went live recently and already covers new accounts and every user who changed a password in the last month.
In the old system a user's cryptographic key was a permutation of the first few letters of the alphabet, repeated many times so that it covered long messages. In the new system the key is random letters produced by a lava lamp based sub-contractor.
For example, BCAEDBCAEDBCAED was a possible key in the old system, because it repeats BCAED, a permutation of the letters A to E. BCDBCD and BABBABBABBAB were not possible: the repeated block BCD has no A, and BAB is not a permutation of AB because it has two Bs.
Halvor wants to replace the keys of the users who have not been moved to the new system automatically. He can read and write every key of his own users, and he hired you to write a program that decides which users need an update. To keep private data out of your hands, you only get the user names, the last login times, and at most the first 1000 letters of each key.
So for a key from the old system the string you receive may stop in the middle of a repetition, but its first letter is the start of a permutation. For a key from the new system the whole string is random, including the letters you receive.
The first line contains one number T, the number of test cases. Each test case is one line with a string K, the first part of a user's cryptographic key.
For each test case, print one line: old if K definitely comes from the old system, new if K definitely comes from the new system, or unknown if the given part of the key does not settle it.