#include <iostream>
using namespace std;
int main(){
int a,b,c;
while(cin>>a>>b>>c){
if(c==1){
if(a!=0&&b!=0){
cout<<"AND"<<endl;
cout<<"OR"<<endl;
}
else if(a==0&&b!=0){
cout<<"OR"<<endl;
cout<<"XOR"<<endl;
}
else if(a!=0&&b==0){
cout<<"OR"<<endl;
cout<<"XOR"<<endl;
}
else{
cout<<"IMPOSSIBLE"<<endl;
}
}
else{
if(a==0&&b==0){
cout<<"AND"<<endl;
cout<<"OR"<<endl;
cout<<"XOR"<<endl;
}
else if(a!=0&&b!=0){
cout<<"XOR"<<endl;
}
else if(a==0&&b!=0){
cout<<"AND"<<endl;
}
else if(a!=0&&b==0){
cout<<"AND"<<endl;
}
}
}
}