N = int(raw_input())
 
st=1 
k=2 

L = [1]
nrbus=1
 
while (k<=N):
    print 1,st,k
    repl = int(raw_input())
    if (repl==0):
        st=k
        k=k+1
        nrbus+=1
        L.append(st)
    else:
        k=k+1

print 2, nrbus,

for el in L:
    print el,