#include <bits/stdc++.h>
using namespace std;
const int maxn = 1007;
const int inf = INT_MAX;
const long long inff = 1e18;
const long long mod = 1e9 + 7;
int n;
int a[maxn], b[maxn];
vector<pair<pair<int, int>, pair<int, int> > > v;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  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++) {
    int atta, attb;
    for (int j = i; j <= n; j++) {
      if (a[j] == i) atta = j;
      if (b[j] == i) attb = j;
    }
    if (atta == attb && atta == i)
      ;
    else {
      v.push_back(make_pair(make_pair(atta, i), make_pair(i, attb)));
      swap(a[atta], a[i]);
      swap(b[attb], b[i]);
    }
  }
  cout << ((int)(v).size()) << endl;
  for (auto i : v)
    cout << i.first.first << ' ' << i.first.second << ' ' << i.second.first
         << ' ' << i.second.second << endl;
}
