def func(arg):
    print(arg,0)
    a = int(input())
    if a == 0:
        exit()
    return a

def sanbunntan(l,r):
    while l + 2 < r:
        c1 = l+(r-l)//3
        c2 = r-(r-l)//3
        if func(c1)<func(c2):
            r = c2
        else:
            l = c1
    val = sorted([(func(i),i) for i in range(l,r+1)])[0][1]
    return val

x = sanbunntan(0, 100001)
y = func(x)-x

print(x,y)
int(input())