Stammering Chemists
时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Like many other organic chemists, you are busy in synthesizing, separating, purifying and identifying new chemical compounds all year round. Getting bored with traditional substance isolation and identification methods, such as column chromatography, a bold idea comes to your mind: Computer Assisted Molecule Identification (CAMI). With this technology, millions of chemists can be freed from arduous manual labor. How promising!

Currently, you are developing a simplified version of CAMI that works for hydrocarbons (organic compounds consisting of hydrogen and carbon only). All hardware-side technologies are done, and you are just going to write the program. The sensor reports all carbon atoms as well as the chemical bonds between them. This naturally forms a graph, where carbon atoms are vertices, and the bonds are edges. Each connected component of this graph corresponds to a molecule, and the component itself is called hydrogen-depleted molecular graph (HDMG) of the molecule, since we generally do not care about hydrogen atoms.

The sensor has just detected some hexane molecules, which is a specific kind of hydrocarbons, consisting of 6 carbon atoms and 14 hydrogen atoms per molecule. There are five essentially different hexanes, also known as isomers:



Your task is to identify, for each hexane molecule detected, which specific type of hexane isomer it is. A molecule should be identified as any of the above isomers if its hydrogen-depleted molecular graph is isomorphic to the HDMG presented in the above table.

输入描述:

The first line of input consists of only a single integer T , denoting the number of hexane molecules detected.

Every five lines of the remaining part of the input specify a molecule detected. Each of the five lines contains two integers a, b , denoting a bond between carbon atoms a and b. In each molecule, the carbon atoms are numbered 1 through 6.

It is guaranteed that, for each molecule in the input, it is exactly one type of the hexane isomers listed above.

输出描述:

For each molecule in the input, display the name of the isomer in one line.
示例1

输入

复制
2
1 2
2 3
3 4
4 5
5 6
1 4
2 3
3 4
4 5
5 6

输出

复制
n-hexane
3-methylpentane