#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n, a[N], b[N], ans;
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];
      ans++;
    }
  printf("%d\n", ans);
  for (int i = 1; i <= n; i++)
    if (a[i] != i || b[i] != i) printf("%d %d %d %d\n", a[i], i, i, b[i]);
}
