a, b, r=map(bool,[int(x)for x in input().split()])AND=a&b==rOR=a|b==rXOR=a^b==rif AND:print("AND")if OR:print("OR")if XOR:print("XOR")if AND|OR|XOR==0:print("IMPOSSIBLE")