def parse(inFile):
return tuple(inFile.getInts())
def solve((N,K)):
return "OFF" if ((K + 1) & ((1 << N) - 1)) else "ON"
if __name__ == "__main__":
from GCJ import GCJ
GCJ(parse, solve, "/Users/lpebody/gcj/2010_q/", "a").run()
ZGVmIHBhcnNlKGluRmlsZSk6CiAgICByZXR1cm4gdHVwbGUoaW5GaWxlLmdldEludHMoKSkKCmRlZiBzb2x2ZSgoTixLKSk6CiAgICByZXR1cm4gIk9GRiIgaWYgKChLICsgMSkgJiAoKDEgPDwgTikgLSAxKSkgZWxzZSAiT04iCgppZiBfX25hbWVfXyA9PSAiX19tYWluX18iOgogICAgZnJvbSBHQ0ogaW1wb3J0IEdDSgogICAgR0NKKHBhcnNlLCBzb2x2ZSwgIi9Vc2Vycy9scGVib2R5L2djai8yMDEwX3EvIiwgImEiKS5ydW4oKQo=