#include <stdio.h>
#include <string.h>
#include <ctype.h>
const char *rev = "A 3 HIL JM O 2TUVWXY51SE Z 8 ";
const char *msg[] = {"not a palindrome", "a regular palindrome", "a mirrored string", "a mirrored palindrome"};
char r(char ch) {
if (isalpha(ch))
return rev[ch - 'A'];
return rev[ch - '0' + 25];
}
int main() {
char s[30];
while (scanf("%s", s) == 1) {
int len = strlen(s);
int p = 1, m = 1;
for (int i = 0; i < (len + 1) / 2; i ++ ) {
if (s[i] != s[len - 1 - i])
p = 0; // 不是回文串
if (r(s[i]) != s[len - 1 - i])
m = 0; // 不是镜像串
}
printf("%s -- is %s.\n\n", s, msg[m * 2 + p]);
}
return 0;
}
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
int main(){
int T;
cin >> T;
while (T -- ){
char s[110];
scanf("%s", s);
int len = strlen(s);
int tot;
for (int i = 1; i <= len; i ++ )
if (len % i == 0){
for (tot = i; tot <= len; tot ++ )
if (s[tot] != s[tot % i])
break;
if (tot == len){
cout << i << endl;
break;
}
}
if (T) cout << endl;
}
return 0;
}
#include <stdio.h>
#include <string.h>
#define maxn 105
int less(const char *s, int p, int q) {
int n = strlen(s);
for (int i = 0; i < n; i ++ )
if (s[(p + i) % n] != s[(q + i) % n])
return s[(p + i) % n] < s[(q + i) % n];
return 0;
}
int main() {
int T;
char s[maxn];
scanf("%d", &T);
while (T -- ) {
scanf("%s", s);
int ans = 0;
int n = strlen(s);
for (int i = 1; i < n; i ++ )
if (less(s, i, ans))
ans = i;
for (int i = 0; i < n; i ++ )
putchar(s[(i + ans) % n]);
putchar('\n');
}
return 0;
}