#include <bits/stdc++.h>
using namespace std;
int N, a[1001], b[1001], c[1001], d[1001];
vector<pair<pair<int, int>, pair<int, int> > > ans;
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> a[i], c[a[i]] = i;
  for (int i = 1; i <= N; i++) cin >> b[i], d[b[i]] = i;
  for (int i = 1; i <= N - 1; i++)
    if (c[i] != i || d[i] != i) {
      if (c[i] == N || d[i] == N)
        ans.push_back({{c[i], i}, {i, d[i]}}),
            c[a[c[i]] = a[i]] = c[i], d[b[d[i]] = b[i]] = d[i];
      else {
        ans.push_back({{c[i], i}, {i, N}}), ans.push_back({{i, d[i]}, {N, i}});
        int A = c[i], B = d[i];
        c[a[A] = a[N]] = A, d[b[B] = b[N]] = B, c[a[N] = a[i]] = N,
                 d[b[N] = b[i]] = N;
      }
    }
  cout << ans.size() << endl;
  for (auto i : ans)
    cout << i.first.first << ' ' << i.first.second << ' ' << i.second.first
         << ' ' << i.second.second << endl;
  return 0;
}
