#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const long double PI = 3.14159265358979323846;
const long double eps = 1e-5;
const int INF = numeric_limits<int>::max();
const long long LINF = numeric_limits<long long>::max();
const long long mod = 1000 * 1000 * 1000 + 7;
void solve() {
  int n;
  cin >> n;
  vector<int> r(n), c(n);
  int d;
  for (int i = 0; i < n; ++i) {
    cin >> d;
    r[d - 1] = i + 1;
  }
  for (int i = 0; i < n; ++i) {
    cin >> d;
    c[d - 1] = i + 1;
  }
  vector<int> p1(n + 1), p2(n + 1);
  for (int i = 0; i <= n; ++i) p1[i] = p2[i] = i;
  vector<int> r1, c1, r2, c2;
  for (int i = 0; i < n; ++i) {
    int x = p1[r[i]], y = p2[c[i]];
    if ((x == i + 1) && (y == i + 1)) continue;
    r1.push_back(i + 1);
    c1.push_back(y);
    r2.push_back(x);
    c2.push_back(i + 1);
    for (int j = 1; j <= n; ++j) {
      if (p1[j] == i + 1) {
        p1[j] = x;
        continue;
      }
      if (p1[j] == x) {
        p1[j] = i + 1;
        continue;
      }
    }
    for (int j = 1; j <= n; ++j) {
      if (p2[j] == i + 1) {
        p2[j] = y;
        continue;
      }
      if (p2[j] == y) {
        p2[j] = i + 1;
        continue;
      }
    }
  }
  cout << r1.size() << endl;
  for (int i = 0; i < r1.size(); ++i) {
    cout << r1[i] << " " << c1[i] << " " << r2[i] << " " << c2[i] << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(nullptr);
  solve();
  return 0;
}
