#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
void swap(int &a, int &b) {
  int temp = a;
  a = b;
  b = temp;
  return;
}
int main() {
  int n, r[N], c[N], posr[N], posc[N], tc, tr;
  vector<pair<pair<int, int>, pair<int, int>>> ans;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &r[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &c[i]);
  for (int i = 1; i <= n; i++) posr[r[i]] = posc[c[i]] = i;
  for (int i = 1; i <= n; i++) {
    if (posr[i] == posc[i] && posc[i] == i)
      continue;
    else {
      ans.push_back({{posr[i], i}, {i, posc[i]}});
      tc = c[i];
      tr = r[i];
      swap(r[i], r[posr[i]]);
      swap(c[i], c[posc[i]]);
      swap(posr[i], posr[tr]);
      swap(posc[i], posc[tc]);
    }
  }
  if (!ans.empty()) {
    printf("%d\n", (int)ans.size());
    for (pair<pair<int, int>, pair<int, int>> i : ans)
      printf("%d %d %d %d\n", i.first.first, i.first.second, i.second.first,
             i.second.second);
  } else
    printf("0\n");
}
