#include <bits/stdc++.h>
using namespace std;
const int Mod = 998244353;
struct rec {
  int x1, y1, x2, y2;
};
vector<rec> ans;
int r[1005], c[1005], n;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> r[i];
  for (int i = 1; i <= n; i++) cin >> c[i];
  for (int i = 1; i <= n - 1; i++) {
    int w1, w2;
    for (int j = i; j <= n; j++)
      if (r[j] == i) {
        w1 = j;
        break;
      }
    for (int j = i; j <= n; j++)
      if (c[j] == i) {
        w2 = j;
        break;
      }
    if (w1 == i && w2 == i) continue;
    ans.push_back((rec){i, w2, w1, i});
    swap(r[i], r[w1]);
    swap(c[i], c[w2]);
  }
  cout << ans.size() << '\n';
  for (rec c : ans)
    cout << c.x1 << ' ' << c.y1 << ' ' << c.x2 << ' ' << c.y2 << '\n';
  return 0;
}
