#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, f = 0;
  char ch = getchar();
  while (!isdigit(ch)) f |= ch == '-', ch = getchar();
  while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
  return f ? -x : x;
}
const int N = 1005;
int n;
int r[N], c[N];
pair<int, int> p1[N], p2[N];
int cnt = 0;
int main() {
  n = read();
  for (int i = (1); i <= (n); i++) r[i] = read();
  for (int i = (1); i <= (n); i++) c[i] = read();
  for (int i = (1); i <= (n - 1); i++) {
    int pr, pc;
    for (int j = (1); j <= (n); j++) {
      if (r[j] == i) pr = j;
      if (c[j] == i) pc = j;
    }
    if (pr == i && pc == i) continue;
    cnt++;
    p1[cnt] = make_pair(i, pc), swap(c[i], c[pc]);
    p2[cnt] = make_pair(pr, i), swap(r[i], r[pr]);
  }
  printf("%d\n", cnt);
  for (int i = (1); i <= (cnt); i++)
    printf("%d %d %d %d\n", p1[i].first, p1[i].second, p2[i].first,
           p2[i].second);
  return 0;
}
