def q(x, y): print(1, x, y, flush=True) return int(input()) n = int(input()) inf = 10**8 + 1 le, ri = -inf, inf while ri - le >= 3: mid1 = (le + le + ri) // 3 mid2 = (le + ri + ri) // 3 if q(mid1, 0) < q(mid2, 0): ri = mid2 else: le = mid1 x, dist = le, q(le, 0) for xx in range(le + 1, ri + 1): d = q(xx, 0) if d < dist: x, dist = xx, d le, ri = -inf, inf while ri - le >= 3: mid1 = (le + le + ri) // 3 mid2 = (le + ri + ri) // 3 if q(x, mid1) < q(x, mid2): ri = mid2 else: le = mid1 y, dist = le, q(x, le) for yy in range(le + 1, ri + 1): d = q(x, yy) if d < dist: y, dist = yy, d print(2, x, y, flush=True)