#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
int n, a[maxn], b[maxn], tot = 0, x, y;
tuple<int, int, int, int> ans[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  for (int i = 1; i <= n; i++) {
    if (a[i] == i && b[i] == i) continue;
    for (int j = i; j <= n; j++)
      if (a[j] == i) {
        swap(a[i], a[j]);
        x = j;
        break;
      }
    for (int j = i; j <= n; j++)
      if (b[j] == i) {
        swap(b[i], b[j]);
        y = j;
        break;
      }
    ans[++tot] = make_tuple(x, i, i, y);
  }
  printf("%d\n", tot);
  for (int i = 1; i <= tot; i++)
    printf("%d %d %d %d\n", get<0>(ans[i]), get<1>(ans[i]), get<2>(ans[i]),
           get<3>(ans[i]));
}
