#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1234;
int N;
int R[MAXN], C[MAXN];
vector<array<int, 4>> ans;
void go(int n) {
  if (n == 0) return;
  if (C[n] == n && R[n] == n) {
  } else {
    for (int i = n - 1; i >= 1; i--) {
      if (R[i] == n) R[i] = R[n];
    }
    for (int i = n - 1; i >= 1; i--) {
      if (C[i] == n) C[i] = C[n];
    }
    ans.push_back({C[n], n, n, R[n]});
  }
  go(n - 1);
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> C[i];
  for (int i = 1; i <= N; i++) cin >> R[i];
  go(N);
  cout << ans.size() << '\n';
  for (auto p : ans) {
    cout << p[0] << ' ' << p[1] << ' ' << p[2] << ' ' << p[3] << '\n';
  }
  return 0;
}
