#include <bits/stdc++.h>
using namespace std;
int n;
int r[1005];
int c[1005];
vector<pair<pair<int, int>, pair<int, int> > > aah;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = (1); i <= (signed)(n); i++) {
    cin >> r[i];
  }
  for (int i = (1); i <= (signed)(n); i++) {
    cin >> c[i];
  }
  for (int i = (1); i <= (signed)(n); i++) {
    int rv, cv;
    for (int j = (1); j <= (signed)(n); j++) {
      if (r[j] == i) {
        rv = j;
      }
      if (c[j] == i) {
        cv = j;
      }
    }
    swap(r[rv], r[i]);
    swap(c[cv], c[i]);
    if (rv != i || cv != i) aah.push_back({{rv, i}, {i, cv}});
  }
  cout << aah.size() << "\n";
  for (auto u : aah) {
    cout << u.first.first << " " << u.first.second << " " << u.second.first
         << " " << u.second.second << "\n";
  }
  return 0;
}
