INF = 1 << 60 MOD = 1000000007 xor = randint(100, INF) def main(): n = int(input()) l, r = -100000001, 100000001 while l+2 < r: m1 = l+(r-l)//3 m2 = r-(r-l)//3 print(1, m1, 0, flush=True) d1 = int(input()) print(1, m2, 0, flush=True) d2 = int(input()) if d1 >= d2: l = m1 else: r = m2 mi, x = INF, 0 for i in range(l, r+1): print(1, i, 0, flush=True) z = int(input()) if z < mi: mi, x = z, i l, r = -100000001, 100000001 while l+2 < r: m1 = l+(r-l)//3 m2 = r-(r-l)//3 print(1, x, m1, flush=True) d1 = int(input()) print(1, x, m2, flush=True) d2 = int(input()) if d1 >= d2: l = m1 else: r = m2 mi, y = INF, 0 for i in range(l, r+1): print(1, x, i, flush=True) z = int(input()) if z < mi: mi, y = z, i print(2, x, y, flush=True) if __name__ == "__main__": main()