#include <bits/stdc++.h>
using namespace std;
int a[1005], b[1005], c[1005], d[1005], posa[1005], posb[1005];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int q = 1; q <= n; q++) {
    int x;
    cin >> x;
    a[x] = q;
  }
  for (int q = 1; q <= n; q++) {
    int x;
    cin >> x;
    b[x] = q;
  }
  for (int q = 1; q <= n; q++) {
    c[q] = d[q] = posa[q] = posb[q] = q;
  }
  vector<array<int, 4>> v;
  for (int q = 1; q <= n; q++) {
    if (c[q] == a[q] && d[q] == b[q]) continue;
    v.push_back({q, posb[b[q]], posa[a[q]], q});
    posb[d[q]] = posb[b[q]];
    posa[c[q]] = posa[a[q]];
    d[posb[d[q]]] = d[q];
    c[posa[c[q]]] = c[q];
  }
  cout << ((int)((v).size())) << '\n';
  for (int q = 0; q < ((int)((v).size())); q++) {
    for (int w = 0; w < 4; w++) cout << v[q][w] << ' ';
    cout << '\n';
  }
  return 0;
}
