#include <bits/stdc++.h>
using namespace std;
int n;
int r[2 * 1005], berHoy[2][1005], dhhuke[2 * 1005];
vector<int> ans;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) dhhuke[i] = i, dhhuke[i + n] = i;
  for (int i = 1; i <= n; i++) {
    cin >> r[i];
    berHoy[0][r[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    cin >> r[n + i];
    berHoy[1][r[n + i]] = n + i;
  }
  for (int i = 1; i < n; i++) {
    int d1, d2, b1, b2;
    for (d1 = 1; d1 <= n; d1++)
      if (dhhuke[d1] == i) break;
    for (d2 = n + 1; d2 <= n + n; d2++)
      if (dhhuke[d2] == i) break;
    b1 = berHoy[0][i];
    b2 = berHoy[1][i];
    if (d1 == b1 && d2 == b2) continue;
    ans.push_back(i);
    ans.push_back(dhhuke[b2]);
    ans.push_back(dhhuke[b1]);
    ans.push_back(i);
    dhhuke[d1] = dhhuke[b1];
    dhhuke[d2] = dhhuke[b2];
    dhhuke[b1] = -1;
    dhhuke[b2] = -1;
  }
  cout << ans.size() / 4 << endl;
  for (int i = 0; i < ans.size(); i += 4)
    cout << ans[i] << " " << ans[i + 1] << " " << ans[i + 2] << " "
         << ans[i + 3] << endl;
  return 0;
}
