#include <bits/stdc++.h>
using namespace std;
int n, cnt = 0;
int r[1001], c[1001];
int posr[1001], posc[1001];
struct portal {
  int xx, yy, x, y;
} ans[1000], t;
inline void add(int a, int b, int c, int d) {
  t.x = a;
  t.y = b;
  t.xx = c;
  t.yy = d;
  ans[cnt] = t;
  cnt++;
  return;
}
void debug(int p) {
  printf("-----%d-----\n", p);
  for (int i = 1; i <= n; i++)
    printf("%d %d %d %d %d\n", i, r[i], c[i], posr[i], posc[i]);
  return;
}
int main(void) {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &r[i]);
    posr[r[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &c[i]);
    posc[c[i]] = i;
  }
  for (int i = n; i > 0; i--) {
    if (r[i] == i && c[i] == i) continue;
    add(i, c[i], r[i], i);
    int R = r[i], C = c[i];
    swap(r[posr[i]], r[i]);
    swap(c[posc[i]], c[i]);
    swap(posr[R], posr[i]);
    swap(posc[C], posc[i]);
  }
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++)
    printf("%d %d %d %d\n", ans[i].x, ans[i].y, ans[i].xx, ans[i].yy);
  return 0;
}
