1 import java.util.*;
2 /**
3 *
4 * @author tunzao
5 * @version 1.0 May 6, 2011
6 *
7 */
8 public class Palindromes
9 {
10 public static void main(String[] args)
11 {
12 Scanner in = new Scanner(System.in);
13 while(in.hasNext())
14 {
15 String s = in.nextLine();
16 if (s.length() == 0)
17 break;
18 char[] ch = s.toCharArray();
19 boolean isPal = true;
20 boolean isMirror = true;
21
22 for (int i = 0, j = ch.length-1; i < j; i++, j--)
23 {
24 if (ch[i] != ch[j])
25 {
26 isPal = false;
27 if (ch[i] != getReverseChar(ch[j]))
28 {
29 isMirror = false;
30 break;
31 }
32 }
33 }
34
35 if (!isPal && !isMirror)
36 System.out.println(s + " -- is not a palindrome.");
37 else if (isPal && !isMirror)
38 System.out.println(s + " -- is a regular palindrome.");
39 else if (!isPal && isMirror)
40 System.out.println(s + " -- is a mirrored string.");
41 else
42 System.out.println(s + " -- is a mirrored palindrome.");
43 }
44 in.close();
45 //System.exit(0);
46 }
47
48 private static char getReverseChar(char c)
49 {
50 switch (c)
51 {
52 case 'A':
53 return 'A';
54 case 'E':
55 return '3';
56 case 'H':
57 return 'H';
58 case 'I':
59 return 'I';
60 case 'J':
61 return 'L';
62 case 'L':
63 return 'J';
64 case 'M':
65 return 'M';
66 case 'O':
67 return 'O';
68 case 'S':
69 return '2';
70
71 case 'T':
72 return 'T';
73 case 'U':
74 return 'U';
75 case 'W':
76 return 'W';
77 case 'X':
78 return 'X';
79 case 'Y':
80 return 'Y';
81 case 'Z':
82 return '5';
83 case '1':
84 return '1';
85 case '2':
86 return 'S';
87 case '3':
88 return 'E';
89 case '5':
90 return 'Z';
91 case '8':
92 return '8';
93 default:
94 return 0;
95 }
96 }
97 }