#include <bits/stdc++.h>
using namespace std;
typedef const int& cint;
const int MAXN = 1010;
int row[MAXN], col[MAXN];
int rid[MAXN], cid[MAXN];
struct Portal {
  int r, c;
  Portal() {}
  Portal(cint r_, cint c_) { r = r_, c = c_; }
} p[MAXN << 1];
int tot;
int main() {
  int N;
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) scanf("%d", &row[i]), rid[row[i]] = i;
  for (int i = 1; i <= N; ++i) scanf("%d", &col[i]), cid[col[i]] = i;
  for (int i = N; i > 1; --i) {
    if (col[i] == i && row[i] == i) continue;
    p[++tot] = Portal(i, col[i]), p[++tot] = Portal(row[i], i);
    row[rid[i]] = row[i], col[cid[i]] = col[i];
    rid[row[i]] = rid[i], cid[col[i]] = cid[i];
  }
  printf("%d\n", tot >> 1);
  for (int i = 1; i <= tot; i += 2)
    printf("%d %d %d %d\n", p[i].r, p[i].c, p[i + 1].r, p[i + 1].c);
  return 0;
}
