#include <bits/stdc++.h>
using namespace std;
const int N = 1050;
const int inf = 0x3f3f3f3f;
const long long llinf = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
clock_t TIME__START, TIME__END;
void program_end() {}
int n;
int r[N], c[N], x[N], y[N], nr[N], nc[N];
struct portal {
  int x1, y1, x2, y2;
};
vector<portal> vec;
inline void solve() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &r[i]), nr[r[i]] = i;
  for (int i = 1; i <= n; ++i) scanf("%d", &c[i]), nc[c[i]] = i;
  for (int i = 1; i <= n; ++i) x[i] = y[i] = i;
  for (int s = 1; s <= n; ++s) {
    if (x[s] == nr[s] && y[s] == nc[s]) continue;
    portal now;
    for (int i = s; i <= n; ++i)
      if (x[i] == nr[s]) {
        now.x1 = i, now.y1 = s;
        swap(x[i], x[s]);
        break;
      }
    for (int j = s; j <= n; ++j)
      if (y[j] == nc[s]) {
        now.x2 = s, now.y2 = j;
        swap(y[j], y[s]);
        break;
      }
    vec.push_back(now);
  }
  cout << vec.size() << '\n';
  for (auto i : vec) printf("%d %d %d %d\n", i.x1, i.y1, i.x2, i.y2);
}
int main() {
  TIME__START = clock();
  int Test = 1;
  while (Test--) {
    solve();
  }
  TIME__END = clock();
  program_end();
  return 0;
}
