#include using namespace std; int main(){ int N; cin >> N; vector A(N); for (int i = 0; i < N; i++){ cin >> A[i]; } vector B(N); for (int i = 0; i < N; i++){ cin >> B[i]; } int h = 0; for (int i = 0; i < N; i++){ for (int j = 0; j < 30; j++){ if ((A[i] >> j & 1) == 1){ h = max(h, j); } if ((B[i] >> j & 1) == 1){ h = max(h, j); } } } vector ap, bp; vector ah(N, false), bh(N, false); for (int i = 0; i < N; i++){ if ((A[i] >> h & 1) == 1){ ap.push_back(i); ah[i] = true; } if ((B[i] >> h & 1) == 1){ bp.push_back(i); bh[i] = true; } } int K = 0; vector T, P, Q; if (ap.empty()){ int x = bp[0]; K++; T.push_back(1); P.push_back(0); Q.push_back(x); ah[0] = true; ap.push_back(0); } if (bp.empty()){ int x = ap[0]; K++; T.push_back(2); P.push_back(x); Q.push_back(0); bh[0] = true; bp.push_back(0); } for (int i = 0; i < N; i++){ if (i != ap[0] && ah[i]){ K++; T.push_back(1); P.push_back(i); Q.push_back(bp[0]); ah[i] = false; } } for (int i = 0; i < N; i++){ if (!bh[i]){ K++; T.push_back(2); P.push_back(ap[0]); Q.push_back(i); bh[i] = true; } } K++; T.push_back(1); P.push_back(ap[0]); Q.push_back(bp[0]); cout << K << endl; for (int i = 0; i < K; i++){ cout << T[i] << ' ' << P[i] + 1 << ' ' << Q[i] + 1 << endl; } }