#include <stdio.h>
#include <string.h>
#include <ctype.h>
char array[35]="A 3 HIL JM O 2TUVWXY5 1SE Z 8 ";
int main()
{
char str[40];
int i,len,flag_pal,flag_mir;
while(scanf("%s",str)==1)
{
flag_pal=1,flag_mir=1;
len = strlen(str);
for(i=0;i<(len+1)/2;i++)
{
if(str[i] != str[len-i-1])flag_pal = 0;
if(isupper(str[i]))
{
if(array[str[i]-'A'] != str[len-i-1]) flag_mir=0;
}
else
{
if(array[str[i]-'0'+26] != str[len-i-1]) flag_mir=0;
}
}
if(flag_pal+flag_mir == 1)
printf("%s\n",flag_pal ? "is a regular palindrome":"is a mirrored string");
else
printf("%s\n",flag_pal ? "is a mirrored palindrome":"is not a palindrome");
printf("\n");
}
return 0;
}