#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int Read() {
  char c;
  c = getchar();
  int tsqua = 0;
  while (c != ' ' && c != '\n') {
    tsqua = (((tsqua << 1) << 1) << 1) + (tsqua << 1) + (int)(c - '0');
    c = getchar();
  }
  return tsqua;
}
struct portals {
  int x1, x2, x3, x4;
  portals(int _x1, int _x2, int _x3, int _x4)
      : x1(_x1), x2(_x2), x3(_x3), x4(_x4) {}
};
vector<portals> ans;
int n;
int a[1010], cnta[1010];
int b[1010], cntb[1010];
int c[1010], cntc[1010];
int d[1010], cntd[1010];
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", b + i);
    cntb[b[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    cnta[a[i]] = i;
  }
  for (int i = 1; i <= n; i++) c[i] = i;
  for (int i = 1; i <= n; i++) cntc[i] = i;
  for (int i = 1; i <= n; i++) d[i] = i;
  for (int i = 1; i <= n; i++) cntd[i] = i;
  for (int i = 1; i < n; i++) {
    if (c[i] == cnta[i] && d[i] == cntb[i]) continue;
    ans.push_back(portals(i, cntc[cnta[i]], cntd[cntb[i]], i));
    int tmpci = c[i], tmpdi = d[i];
    swap(c[i], c[cntc[cnta[i]]]);
    swap(d[i], d[cntd[cntb[i]]]);
    swap(cntc[cnta[i]], cntc[tmpci]);
    swap(cntd[cntb[i]], cntd[tmpdi]);
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].x1 << ' ' << ans[i].x2 << ' ' << ans[i].x3 << ' '
         << ans[i].x4 << endl;
  return 0;
}
