#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 7;
struct node {
  int x1, y1, x2, y2;
  node() {}
  node(int _x1, int _y1, int _x2, int _y2)
      : x1(_x1), y1(_y1), x2(_x2), y2(_y2) {}
} q[N];
int n, m, r[N], r1[N], c[N], c1[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &r[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &c[i]);
  for (int i = 1; i <= n; i++) {
    if (r[i] == i && c[i] == i) continue;
    int x, y;
    for (int j = i; j <= n; j++)
      if (r[j] == i) r[j] = r[i], x = j;
    for (int j = i; j <= n; j++)
      if (c[j] == i) c[j] = c[i], y = j;
    q[++m] = node(x, i, i, y);
  }
  printf("%d\n", m);
  for (int i = 1; i <= m; i++)
    printf("%d %d %d %d\n", q[i].x1, q[i].y1, q[i].x2, q[i].y2);
}
