def f(l, r, M): if len(ans)==5: return 0 used.add((l, r)) K = r-l R = [] for i in range(l, r): R.append(i) print(M, K, flush=True) print(*R, flush=True) C = int(input()) if C==0: return 0 if K==1 and C==1: ans.append(l) return 1 # left if (l, (l+r)//2) not in used: f(l, (l+r)//2, M) # right if ((l+r)//2, r) not in used: f((l+r)//2, r, M) import sys input = sys.stdin.readline N = int(input()) l = 0 r = N+1 ans = [] used = set() # left f(l, (l+r)//2, N+1) # right f((l+r)//2, r, N+1) print(0, 1, flush=True) print(sum(ans))