Welcome to ZOJ
Information
Select Problem
Runs
Ranklist
ZOJ Problem Set - 2512
Exact Symmetry

Time Limit: 2 Seconds      Memory Limit: 65536 KB

CYJJ was window-shopping at a jewelry store and was attracted by a show window full of colorful necklaces. Obsessed with symmetry, she instantly tried to find if a necklace is symmetric.

A necklace consists of colorful beads, and is called symmetric if the color of beads are symmetric with respect to some central beads. For example, the necklace in Figure 1 are symmetric with respect to the red beads, and the one in Figure 2 is not. How about Figure 3? When a necklace is too long with too many colors, CYJJ would need your help to tell her if it is symmetric or not.

       
Figure 1
Figure 2
Figure 3
Input

The input consists of multiple test cases. Each test case consists of a line of no more than 1000 lower case English letters of which each represents the color of a bead.

Output

For each test case, first output "Symmetric" or "Not symmetric" in a line. If the necklace is symmetric, then output the smallest index (or pair of indices) of its symmetric center in the next line. The index starts from 1 and the output format is shown in the samples.

Sample Input:
rrb
rrbnrrnb
brbnwppwn
nbrbnwprpw
wrwgyygrw
wybnwgpybpnpbypgwnbywrgr
Sample Output:
Symmetric
1-2
Symmetric
1-2
Symmetric
2
Symmetric
3
Not symmetric
Symmetric
11


Author: CHEN, Yue
Source: CYJJ's Funny Contest #1, Killing in Seconds
Submit    Status