#include <bits/stdc++.h>
using namespace std;
bool home = 1;
signed realMain();
signed main() {
  home = 0;
  if (home) {
    freopen("input", "r", stdin);
  } else {
    ios::sync_with_stdio(0);
    cin.tie(0);
  }
  realMain();
}
const long long N = 1000 + 7;
long long n, r[N], c[N], nowr[N], nowc[N], needr[N], needc[N];
signed realMain() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> nowr[i];
    needr[i] = i;
  }
  for (long long i = 1; i <= n; i++) {
    cin >> nowc[i];
    needc[i] = i;
  }
  vector<vector<long long>> ret;
  for (long long i = 1; i <= n; i++) {
    if (nowr[i] == needr[i] && nowc[i] == needc[i]) continue;
    long long rguy = -1;
    for (long long r = i; r <= n; r++) {
      if (nowr[r] == needr[i]) {
        rguy = r;
      }
    }
    long long cguy = -1;
    for (long long c = i; c <= n; c++) {
      if (nowc[c] == needc[i]) {
        cguy = c;
      }
    }
    assert(rguy != -1);
    assert(cguy != -1);
    ret.push_back({rguy, i, i, cguy});
    swap(nowr[rguy], nowr[i]);
    swap(nowc[cguy], nowc[i]);
  }
  cout << (long long)ret.size() << "\n";
  for (auto &v : ret) {
    for (auto &x : v) {
      cout << x << " ";
    }
    cout << "\n";
  }
  return 0;
}
