#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n + 1], b[n + 1];
  int p[n + 1], q[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    p[a[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
    q[b[i]] = i;
  }
  vector<pair<pair<int, int>, pair<int, int>>> v;
  int ans = 0;
  int size = n;
  int row_col = 1;
  while (size >= 1) {
    if (!(a[row_col] == row_col && b[row_col] == row_col)) {
      v.push_back(make_pair(make_pair(p[row_col], row_col),
                            make_pair(row_col, q[row_col])));
      int temp = a[row_col];
      swap(a[row_col], a[p[row_col]]);
      swap(p[row_col], p[temp]);
      temp = b[row_col];
      swap(b[row_col], b[q[row_col]]);
      swap(q[row_col], q[temp]);
      ans += 1;
    }
    row_col++;
    size--;
  }
  cout << ans << endl;
  for (int i = 0; i < v.size(); i++) {
    cout << v[i].first.first << " " << v[i].first.second << " ";
    cout << v[i].second.first << " " << v[i].second.second << endl;
  }
  return 0;
}
