#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &res) {
  res = 0;
  T f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    res = res * 10 + c - '0';
    c = getchar();
  }
  res *= f;
}
template <class T>
void out(T x) {
  if (x < 0) {
    x = -x;
    putchar('-');
  }
  if (x >= 10) {
    out(x / 10);
  }
  putchar('0' + x % 10);
}
int N;
int r[1005], c[1005], posr[1005], posc[1005], tot;
pair<int, int> x[1005], y[1005];
void Solve() {
  read(N);
  for (int i = 1; i <= N; ++i) {
    read(r[i]);
    posr[r[i]] = i;
  }
  for (int i = 1; i <= N; ++i) {
    read(c[i]);
    posc[c[i]] = i;
  }
  for (int i = 1; i <= N; ++i) {
    if (r[i] == i && c[i] == i) continue;
    x[++tot] = make_pair(posr[i], i);
    y[tot] = make_pair(i, posc[i]);
    r[posr[i]] = r[i];
    posr[r[i]] = posr[i];
    c[posc[i]] = c[i];
    posc[c[i]] = posc[i];
  }
  out(tot);
  putchar('\n');
  for (int i = 1; i <= tot; ++i) {
    out(x[i].first);
    putchar(' ');
    out(x[i].second);
    putchar(' ');
    out(y[i].first);
    putchar(' ');
    out(y[i].second);
    putchar('\n');
  }
}
int main() {
  Solve();
  return 0;
}
