#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int a[N], b[N], n;
vector<pair<pair<int, int>, pair<int, int> > > ans;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  for (int i = 1; i < n; i++) {
    if (a[i] == i && b[i] == i) continue;
    int c = 0, d = 0;
    for (int j = 1; j <= n; j++)
      if (a[j] == i) c = j;
    for (int j = 1; j <= n; j++)
      if (b[j] == i) d = j;
    ans.push_back(make_pair(make_pair(i, d), make_pair(c, i)));
    swap(a[i], a[c]);
    swap(b[i], b[d]);
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first.first << " " << ans[i].first.second << " "
         << ans[i].second.first << " " << ans[i].second.second << endl;
  return 0;
}
