from sys import stdin, stdout, stderr, exit

values = [0,0,0,0]

def read(what_to_do: (int, int)): # (which, how many)
    global values
    direction = ['left', 'top', 'right', 'bottom']
    #stderr.write(' '.join([' '.join(map(str,a)) for a in zip(direction, values)]) + '\n')
    #stderr.flush()

    (which,how_many) = what_to_do

    if how_many == 0:
        stdout.write('pass\n')
        stdout.flush()
    else:
        stdout.write('{} {}\n'.format(direction[which], how_many))
        stdout.flush()

    values[which] -= how_many
    #assert how_many >= 0
    #assert values[which] >= 0

    inp = stdin.readline()
    if inp[:5] == 'yuck!':
        exit(0)
    (ans_which, ans_how_many) = inp.split(' ')
    ans_how_many = int(ans_how_many)

    for (i, v) in enumerate(direction):
        if v == ans_which:
            values[i] -= ans_how_many
            break

def play():
    global values
    while True:
        V = values[0] ^ values[1] ^ values[2] ^ values[3]

        megoldas = (0,0)
        if V != 0:
            for i in range(4):
                val = values[i]
                kell = V^val
                if kell < val:
                    megoldas = (i,val-kell)
                    break
                    #read((i, val-(V^val)))
            #assert megoldas != (0,0)
        read(megoldas) # pass

def main():
    global values
    R,C,K = map(int, stdin.readline().split(' '))

    mnr, mnc, mxr, mxc = (R+1, C+1, -1, -1)
    for _ in range(K):
        r,c = map(int, stdin.readline().split(' '))
        mnr = min(mnr, r)
        mnc = min(mnc, c)
        mxr = max(mxr, r)
        mxc = max(mxc, c)
    values = [mnc-1, mnr-1, C-mxc, R-mxr]
    #stderr.write(' '.join(map(str, values)))
    play()

main()
