#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1005;
inline int readint() {
  int res = 0, f = 1;
  char c = 0;
  while (!isdigit(c)) {
    c = getchar();
    if (c == '-') f = -1;
  }
  while (isdigit(c)) res = res * 10 + c - '0', c = getchar();
  return res * f;
}
int n, a[MAXN], b[MAXN], ia[MAXN], ib[MAXN];
int ansx[MAXN][2], ansy[MAXN][2], tot;
int main() {
  n = readint();
  for (int i = 1; i <= n; i++) a[i] = readint(), ia[a[i]] = i;
  for (int i = 1; i <= n; i++) b[i] = readint(), ib[b[i]] = i;
  for (int i = 1; i <= n; i++) {
    if (ia[i] == i && ib[i] == i) continue;
    tot++;
    ansx[tot][0] = i, ansy[tot][0] = ib[i];
    ansx[tot][1] = ia[i], ansy[tot][1] = i;
    ia[a[i]] = ia[i], a[ia[i]] = a[i];
    ib[b[i]] = ib[i], b[ib[i]] = b[i];
  }
  cout << tot << endl;
  for (int i = 1; i <= tot; i++)
    cout << ansx[i][0] << " " << ansy[i][0] << " " << ansx[i][1] << " "
         << ansy[i][1] << endl;
  return 0;
}
