#include <iostream>
using namespace std;
int main(){
int a, b, c;
while (cin >> a >> b >> c){
if (a!=0) a=1;
if (b!=0) b=1;
bool found=false;
if ((a&b)==c){
found=true;
cout <<"AND\n";
}
if ((a|b)==c){
found=true;
cout <<"OR\n";
}
if ((a^b)==c){
found=true;
cout <<"XOR\n";
}
if (!found)
cout <<"IMPOSSIBLE\n";
}
return 0;
}