#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
struct Node {
  int a, b, c, d;
};
vector<Node> ans;
int n, a[N], b[N], c[N], d[N], ra[N], rb[N], rc[N], rd[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
    rb[b[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    ra[a[i]] = i;
  }
  for (int i = 1; i <= n; i++) c[i] = d[i] = rc[i] = rd[i] = i;
  for (int i = 1; i < n; i++) {
    if (c[i] == ra[i] && d[i] == rb[i]) continue;
    ans.push_back({i, rc[ra[i]], rd[rb[i]], i});
    int t1 = c[i], t2 = d[i];
    swap(c[i], c[rc[ra[i]]]);
    swap(d[i], d[rd[rb[i]]]);
    swap(rc[ra[i]], rc[t1]);
    swap(rd[rb[i]], rd[t2]);
  }
  printf("%d\n", ans.size());
  for (auto &i : ans) printf("%d %d %d %d\n", i.a, i.b, i.c, i.d);
  return 0;
}
