#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> c(n + 1);
  vector<int> r(n + 1);
  for (int i = 0; i < (int)(n); ++i) {
    cin >> c[i + 1];
  }
  for (int i = 0; i < (int)(n); ++i) {
    cin >> r[i + 1];
  }
  vector<pair<int, pair<int, int> > > a;
  for (int i = 1; i <= n; i++) {
    int C, R;
    for (int j = 1; j <= n; j++) {
      if (c[j] == i) {
        C = j;
      }
    }
    for (int j = 1; j <= n; j++) {
      if (r[j] == i) {
        R = j;
      }
    }
    if (C == i && R == i) continue;
    a.push_back(make_pair(i, make_pair(C, R)));
    swap(c[C], c[i]);
    swap(r[i], r[R]);
  }
  cout << a.size() << endl;
  for (auto x : a) {
    cout << x.second.first << " " << x.first << " " << x.first << " "
         << x.second.second << endl;
  }
  return 0;
}
