#include <bits/stdc++.h>
using namespace std;
int const N = 1000;
int tor[N + 1], toc[N + 1], cr[N + 1], cc[N + 1], pr[N + 1], pc[N + 1],
    tmp[N + 1];
vector<pair<int, int> > an;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < (int)(n + 1); ++i) scanf("%d", tmp + i);
  for (int i = 1; i < (int)(n + 1); ++i) tor[tmp[i]] = i;
  for (int i = 1; i < (int)(n + 1); ++i) scanf("%d", tmp + i);
  for (int i = 1; i < (int)(n + 1); ++i) toc[tmp[i]] = i;
  for (int i = 1; i < (int)(n + 1); ++i) cr[i] = i;
  for (int i = 1; i < (int)(n + 1); ++i) cc[i] = i;
  for (int i = 1; i < (int)(n + 1); ++i) pr[i] = i;
  for (int i = 1; i < (int)(n + 1); ++i) pc[i] = i;
  for (int i = 1; i < (int)(n); ++i) {
    int a = pr[tor[i]], b = pc[toc[i]];
    if (a != i || b != i) {
      an.emplace_back(a, i);
      an.emplace_back(i, b);
      swap(cr[i], cr[a]);
      swap(pr[cr[i]], pr[cr[a]]);
      swap(cc[i], cc[b]);
      swap(pc[cc[i]], pc[cc[b]]);
    }
  }
  printf("%d\n", (int)an.size() >> 1);
  for (int i = 0; i < (int)(an.size()); ++i)
    printf("%d %d ", an[i].first, an[i].second), ++i,
        printf("%d %d\n", an[i].first, an[i].second);
}
