Hide

Problem C
Screwy School Systems

You are an administrator at CodePSU High School. For some stupid reason, the computer systems for the school district are being screwy. You are given a list of names to enter into the system. When the names are entered into the system, they are displayed in a square matrix (illustrated below). They have a glitch associated with the names. Any name that is the same length as all adjacent (neighboring) names, excluding diagonally adjacent names, will break the system if not manually reported to it. Uh oh! That means you have to find this name so it can be reported to the IT department. Keep in mind that this is a very specific glitch, so there will only ever be one or zero instances of this glitch in each test case.

Adam

Jessica

Rajesh

Gary

Kelly

Kent

Ricky

Barbara

Shantelle

Mikaela

Penny

Kent

Rachel

Morty

Katie

Phung

Input

The input consists of $N$ test cases ($1 \leq N \leq 200$). The first line of input contains the single integer $N$, indicating how many lines will follow the first line. Each of the next $N$ lines contains a single test case. Each line contains a string of $L$ names ($9 \leq L \leq 100$). The number of names will always be a perfect square. There will be a single space separating each name. The length of each name will not exceed $12$ characters or be shorter than $2$ characters.

Output

For each line of names in the input, output one line, containing the name that will screw up our computer systems. There should only be one name on each line of output. If the glitch did not occur in a given test case, output “Name Not Found” (without quotes; refer to sample data). The number of lines of output should correspond to the number of lines of input N.

Sample Input 1 Sample Output 1
4
Junita Alvera Neville Barbar Dannie Obdulia Kiley Bruno Aracelis 
Me Gen Temp Kendo Brandy Sharise Nourmant Marry Mike 
Latarsha Lakiesha Al Kayleigh Lucio Buford Karlyn Shena Rhoda
Darrel Darrel Danialle Kremis Riley Taneka Genia Salvador Katharyn
Junita
Name Not Found
Latarsha
Darrel

Please log in to submit a solution to this problem

Log in