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 = ['top', 'right', 'bottom', 'left']

    (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]

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


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

    mnx, mny, mxx, mxy = (X+1, Y+1, -1, -1)
    for _ in range(K):
        A,B = map(int, stdin.readline().split(' '))
        mnx = min(mnx, A)
        mny = min(mny, B)
        mxx = max(mxx, A)
        mxy = max(mxy, B)
    values = [mnx-1, mny-1, X-mxx, Y-mxy]
    #stderr.write(' '.join(map(str, values)))
    play()

main()
