#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int N = 1024;
int n, r[N], c[N];
vector<tuple<int, int, int, int>> ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", r + i);
  for (int i = 1; i <= n; ++i) scanf("%d", c + i);
  for (int f = 1; f <= n; ++f) {
    int i = find(r + 1, r + n + 1, f) - r;
    int j = find(c + 1, c + n + 1, n - f + 1) - c;
    if (r[f] != f || c[n - f + 1] != n - f + 1) {
      ans.push_back({f, j, r[f], n - f + 1});
      swap(r[i], r[f]);
      swap(c[j], c[n - f + 1]);
    }
  }
  printf("%d\n", (int)ans.size());
  for (auto [a, b, c, d] : ans) printf("%d %d %d %d\n", a, b, c, d);
  return 0;
}
