#include using namespace std; #define rep(i,n) for(int i=0;i=0;--i) #define debug(output) if(debugFlag)cout<<#output<<"= "< P; const bool debugFlag=true; const lint linf=1.1e18;const int inf=1.01e9; constexpr int MOD=1000000007; templatebool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; } templatebool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; } signed main(){ int n;cin>>n; vector a(n),b(n); rep(i,n)cin>>a[i]; rep(i,n)cin>>b[i]; int f=max(*max_element(a.begin(),a.end()),*max_element(b.begin(),b.end())); while(f!=(f&(-f)))f-=(f&(-f)); int ai=-1;int bi=-1; rep(i,n){ if(a[i]&f)ai=i; if(b[i]&f)bi=i; } vector> res; if(ai==-1){ ai=0; a[0]^=b[bi]; res.push_back({1,1,bi+1}); } else{ bi=0; b[0]^=a[ai]; res.push_back({2,ai+1,1}); } rep(i,n){ if((a[i]&f)>0&&i!=ai){ a[i]^=b[bi]; res.push_back({1,i+1,bi+1}); } if((b[i]&f)==0){ b[i]^=a[ai]; res.push_back({2,ai+1,i+1}); } } a[ai]^=b[bi]; res.push_back({1,ai+1,bi+1}); cout<