#include <cstdio>
#include <string>
const int kinds[24][6] = {
{1,2,3,4,5,6},{1,4,2,5,3,6},{1,5,4,3,2,6},{1,3,5,2,4,6},
{6,2,4,3,5,1},{6,3,2,5,4,1},{6,5,3,4,2,1},{6,4,5,2,3,1},
{2,6,3,4,1,5},{2,4,6,1,3,5},{2,1,4,3,6,5},{2,3,1,6,4,5},
{5,6,4,3,1,2},{5,3,6,1,4,2},{5,1,3,4,6,2},{5,4,1,6,3,2},
{3,2,6,1,5,4},{3,1,2,5,6,4},{3,5,1,6,2,4},{3,6,5,2,1,4},
{4,2,1,6,5,3},{4,6,2,5,1,3},{4,5,6,1,2,3},{4,1,5,2,6,3}
};
//{1,2,3,4,5,6},{1,4,2,5,2,6},{1,5,4,3,2,6},{1,2,5,2,4,6},
//{2,3,1,6,4,5},{2,6,3,4,1,5},{2,4,6,1,3,5},{2,1,4,3,6,5},
//{3,1,2,5,6,4},{3,2,6,1,5,4},{3,6,5,2,1,4},{3,5,1,6,2,4},
//{4,1,5,2,6,3},{4,2,1,6,5,3},{4,6,2,5,1,3},{4,5,6,1,2,3},
//{5,1,3,4,6,2},{5,3,6,1,4,2},{5,4,1,6,3,2},{5,6,4,3,1,2},
//{6,2,4,3,5,1},{6,3,2,5,4,1},{6,4,5,2,3,1},{6,5,3,4,2,1}
//};
int main()
{
char s1[13], s2[7];
while(scanf("%s", s1) != EOF) {
for(int i = 0; i < 6; i++) s2[i] = s1[6+i];
int i;
for(i = 0; i < 24; i++) {
int j;
for(j = 0; j < 6; j++) if(s1[j] != s2[kinds[i][j]-1]) break;
if(j == 6) {break;}
}
if(i == 24) puts("FALSE");
else puts("TRUE");
}
return 0;
}
uva 253
最新推荐文章于 2022-02-02 23:02:14 发布