#include <bits/stdc++.h>
using namespace std;
int n, cnt = 0;
int a[2005], b[2005], x1[2005], x2[2005], qwe1[2005], ewq2[2005];
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++) {
    int pos1 = i, pos2 = i;
    for (int r = i; r <= n; r++) {
      if (a[r] < a[pos1]) pos1 = r;
      if (b[r] < b[pos2]) pos2 = r;
    }
    if (pos1 != i || pos2 != i) {
      cnt++;
      x1[cnt] = pos1, qwe1[cnt] = x2[cnt] = i;
      ewq2[cnt] = pos2;
      swap(a[pos1], a[i]);
      swap(b[pos2], b[i]);
    }
  }
  cout << cnt << endl;
  for (int i = 1; i <= cnt; i++)
    printf("%d %d %d %d\n", x1[i], qwe1[i], x2[i], ewq2[i]);
}
