operation=[] n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=[(a[i],i) for i in range(n)] d=[(b[i],i) for i in range(n)] c.sort(reverse=True) d.sort() for i in range(n): x,p=c[i] y,q=d[i] if x>y: operation.append((1,p,q)) operation.append((2,p,q)) operation.append((1,p,q)) elif x==y: operation.append((1,p,q)) print(len(operation)) for t,p,q in operation: print(t,p+1,q+1)