import sys

def fprint(s):
    print "%s %s" % (s[0], s[1])
    sys.stdout.flush()

n = 1
fprint([0, 0])


i = 0
while True:
    j = 0

    alt = int(raw_input())
    if not alt:
        sys.exit(0)

    if alt < 0:
        while alt < 0 and j < 200:
            fprint([i, j])
            alt = int(raw_input())
            j += 1
            if not alt:
                sys.exit(0)
    else:
        fprint([i+1, j])
    i += 1