See the problem statement here: [http://codeforces.com/contest/921/problem/01](//codeforces.com/contest/921/problem/01).
none
none
p = print

def movedown():
    p("for-99")
    p("move-right")
    p("if-ok break else move-down endif")
    p("end")

def justmove(direction):
    p("for-13 move-{} end".format(direction))

def moveandtake(direction):
    p("for-99")
    p("take move-{}".format(direction))
    p("if-ok continue else open-{} if-ok continue else break endif endif".format(direction))
    p("end")

p("for-31")

movedown()

p("for-250")
moveandtake("up")
p("move-right")
moveandtake("down")
p("move-right")
p("end")

p("for-249")
p("move-left")
justmove("up")
p("move-left")
justmove("down")
p("end")

p("move-left move-down")

p("end")  # for-31

p("for-117 move-down end")

p("for-500 open-right move-right end")
