#include <stdio.h>
#pragma warning( disable : 4996 )
int main()
{
int a, b, c;
while (scanf("%d %d %d", &a, &b, &c) != EOF) {
if (a == 0 && b == 0 && c == 0) {
printf("AND\n");
printf("OR\n");
printf("XOR\n");
}
else if (a != 0 && b == 0 && c == 0 || a == 0 && b != 0 && c == 0) {
printf("AND\n");
}
else if (a == 0 && b != 0 && c != 0 || a != 0 && b == 0 && c != 0) {
printf("OR\n");
printf("XOR\n");
}
else if (a != 0 && b != 0 && c == 0) {
printf("XOR");
}
else if (a != 0 && b != 0 && c != 0) {
printf("AND\n");
printf("OR\n");
}
else {
printf("IMPOSSIBLE\n");
}
}
return 0;
}