#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int n, x, y, a[maxn], b[maxn], tot = 0;
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) {}
};
Node 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)
    printf("%d %d %d %d\n", ans[i].a, ans[i].b, ans[i].c, ans[i].d);
  return 0;
}
