#include <bits/stdc++.h>
using namespace std;
template <typename _T>
inline void _DBG(const char *s, _T x) {
  cerr << s << " = " << x << "\n";
}
template <typename _T, typename... args>
void _DBG(const char *s, _T x, args... a) {
  while (*s != ',') cerr << *s++;
  cerr << " = " << x << ',';
  _DBG(s + 1, a...);
}
const int N = 1e3 + 7;
int n, R[N], C[N];
int DC[N], DR[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> R[i];
  for (int i = 1; i <= n; i++) cin >> C[i];
  for (int i = 1; i <= n; i++) {
    if (C[i] != i) {
      for (int j = i + 1; j <= n; j++) {
        if (C[j] == i) {
          DC[i] = j;
          swap(C[i], C[j]);
          break;
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (R[i] != i) {
      for (int j = i + 1; j <= n; j++) {
        if (R[j] == i) {
          DR[i] = j;
          swap(R[i], R[j]);
        }
      }
    }
  }
  vector<pair<pair<int, int>, pair<int, int> > > ans;
  for (int i = 1; i <= n; i++) {
    if (!DR[i] && !DC[i]) continue;
    if (!DR[i]) {
      ans.push_back({{i, i}, {i, DC[i]}});
    } else if (!DC[i]) {
      ans.push_back({{i, i}, {DR[i], i}});
    } else {
      ans.push_back({{i, DC[i]}, {DR[i], i}});
    }
  }
  cout << (int)(ans).size() << "\n";
  for (auto p : ans) {
    auto a = p.first, b = p.second;
    cout << a.first << " " << a.second << " " << b.first << " " << b.second
         << "\n";
  }
  return 0;
}
