#include <bits/stdc++.h>
using namespace std;
int N;
int R[1010], C[1010];
int P[1010], Q[1010];
vector<vector<int>> V;
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  cin >> N;
  for (i = 0; i < (N); i++) {
    cin >> R[i];
    R[i]--;
    P[R[i]] = i;
  }
  for (i = 0; i < (N); i++) {
    cin >> C[i];
    C[i]--;
    Q[C[i]] = i;
  }
  for (i = 0; i < (N); i++) {
    if (P[i] == i && Q[i] == i) continue;
    for (y = i; y < N; y++)
      if (R[y] == i) break;
    for (x = i; x < N; x++)
      if (C[x] == i) break;
    if (y == i && x == i) continue;
    V.push_back({y, i, i, x});
    swap(R[y], R[i]);
    P[R[y]] = y;
    P[R[i]] = i;
    swap(C[x], C[i]);
    Q[C[x]] = x;
    Q[C[i]] = i;
  }
  cout << V.size() << endl;
  for (auto& v : V)
    cout << v[0] + 1 << " " << v[1] + 1 << " " << v[2] + 1 << " " << v[3] + 1
         << endl;
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  cout.tie(0);
  solve();
  return 0;
}
