#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int n, m, a[N], b[N], a1[N], b1[N], a2[N], b2[N];
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 = n; i; i--)
    if (a[i] != i || b[i] != i) {
      for (int j = (1); j <= (i); j++)
        if (a[j] == i) a[j] = a[i];
      for (int j = (1); j <= (i); j++)
        if (b[j] == i) b[j] = b[i];
      a1[++m] = a[i];
      b1[m] = i;
      a2[m] = i;
      b2[m] = b[i];
    }
  printf("%d\n", m);
  for (int i = (1); i <= (m); i++)
    printf("%d %d %d %d\n", a1[i], b1[i], a2[i], b2[i]);
  return 0;
}
