#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
const long long int mod = 998244353;
const long long int big = 2.19e15 + 1;
const long double pai = 3.141592653589793238462643383279502884197;
const long double eps = 1e-15;
template <class T, class U>
bool mineq(T& a, U b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T, class U>
bool maxeq(T& a, U b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
long long int gcd(long long int a, long long int b) {
  if (a % b == 0) {
    return b;
  } else
    return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  if (a == 0) {
    return b;
  }
  return a / gcd(a, b) * b;
}
template <class T>
void SO(T& ve) {
  sort(ve.begin(), ve.end());
}
template <class T>
void REV(T& ve) {
  reverse(ve.begin(), ve.end());
}
template <class T>
long long int LBI(vector<T>& ar, T in) {
  return lower_bound(ar.begin(), ar.end(), in) - ar.begin();
}
template <class T>
long long int UBI(vector<T>& ar, T in) {
  return upper_bound(ar.begin(), ar.end(), in) - ar.begin();
}
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, i, j;
  cin >> n;
  vector<int> r(n);
  for (i = 0; i < n; i++) {
    cin >> r[i];
    r[i]--;
  }
  vector<int> c(n);
  for (i = 0; i < n; i++) {
    cin >> c[i];
    c[i]--;
  }
  vector<tuple<int, int, int, int>> ans;
  for (i = 0; i < n; i++) {
    if (r[i] == i && c[i] == i) {
      continue;
    }
    int gr, gc;
    for (j = i; j < n; j++) {
      if (r[j] == i) {
        swap(r[i], r[j]);
        gr = j;
        break;
      }
    }
    for (j = i; j < n; j++) {
      if (c[j] == i) {
        swap(c[i], c[j]);
        gc = j;
        break;
      }
    }
    ans.push_back(make_tuple(gr + 1, i + 1, i + 1, gc + 1));
  }
  cout << ans.size() << endl;
  for (auto it : ans) {
    int q, w, e, r;
    tie(q, w, e, r) = it;
    cout << q << " " << w << " " << e << " " << r << endl;
  }
  return 0;
}
