#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
int n, a[maxn], b[maxn], tot = 0, x, y;
struct node {
  int a, b, c, d;
  node(){};
  node(int aa, int bb, int cc, int dd) {
    a = aa;
    b = bb;
    c = cc;
    d = dd;
  }
} ans[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  for (int i = 1; i <= n; i++) {
    if (a[i] == i && b[i] == i) continue;
    for (int j = i; j <= n; j++)
      if (a[j] == i) {
        swap(a[i], a[j]);
        x = j;
        break;
      }
    for (int j = i; j <= n; j++)
      if (b[j] == i) {
        swap(b[i], b[j]);
        y = j;
        break;
      }
    ans[++tot] = node(x, i, i, y);
  }
  printf("%d\n", tot);
  for (int i = 1; i <= tot; i++)
    cout << ans[i].a << ' ' << ans[i].b << ' ' << ans[i].c << ' ' << ans[i].d
         << '\n';
}
