#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char c = getchar();
  int x = 0;
  bool f = 0;
  for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45);
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  if (f) x = -x;
  return x;
}
struct modint {
  int x;
  modint(int o = 0) { x = o; }
  modint &operator=(int o) { return x = o, *this; }
  modint &operator+=(modint o) {
    return x = x + o.x >= 1000000007 ? x + o.x - 1000000007 : x + o.x, *this;
  }
  modint &operator-=(modint o) {
    return x = x - o.x < 0 ? x - o.x + 1000000007 : x - o.x, *this;
  }
  modint &operator*=(modint o) { return x = 1ll * x * o.x % 1000000007, *this; }
  modint &operator^=(int b) {
    modint a = *this, c = 1;
    for (; b; b >>= 1, a *= a)
      if (b & 1) c *= a;
    return x = c.x, *this;
  }
  modint &operator/=(modint o) { return *this *= o ^= 1000000007 - 2; }
  modint &operator+=(int o) {
    return x = x + o >= 1000000007 ? x + o - 1000000007 : x + o, *this;
  }
  modint &operator-=(int o) {
    return x = x - o < 0 ? x - o + 1000000007 : x - o, *this;
  }
  modint &operator*=(int o) { return x = 1ll * x * o % 1000000007, *this; }
  modint &operator/=(int o) { return *this *= ((modint(o)) ^= 1000000007 - 2); }
  template <class I>
  friend modint operator+(modint a, I b) {
    return a += b;
  }
  template <class I>
  friend modint operator-(modint a, I b) {
    return a -= b;
  }
  template <class I>
  friend modint operator*(modint a, I b) {
    return a *= b;
  }
  template <class I>
  friend modint operator/(modint a, I b) {
    return a /= b;
  }
  friend modint operator^(modint a, int b) { return a ^= b; }
  friend bool operator==(modint a, int b) { return a.x == b; }
  friend bool operator!=(modint a, int b) { return a.x != b; }
  bool operator!() { return !x; }
  modint operator-() { return x ? 1000000007 - x : 0; }
};
int n, r[1003], c[1003];
vector<pair<pair<int, int>, pair<int, int> > > res;
signed main() {
  n = read();
  for (register int i = (1); i <= (n); ++i) r[i] = read();
  for (register int i = (1); i <= (n); ++i) c[i] = read();
  for (register int i = (1); i <= (n - 1); ++i) {
    int p1, p2;
    for (register int j = (1); j <= (n); ++j) {
      if (r[j] == i) p1 = j;
      if (c[j] == i) p2 = j;
    }
    if (p1 == i && p2 == i) continue;
    res.push_back(make_pair(make_pair(i, p2), make_pair(p1, i)));
    swap(c[i], c[p2]);
    swap(r[i], r[p1]);
  }
  cout << res.size() << endl;
  for (auto t : res)
    cout << t.first.first << ' ' << t.first.second << ' ' << t.second.first
         << ' ' << t.second.second << endl;
  return 0;
}
