#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 100100;
const int INF = 2147483600;
int N;
int R[MAXN + 1], C[MAXN + 1];
int Pr[MAXN + 1], Pc[MAXN + 1];
int top;
int vc[4][MAXN + 1];
inline void solve(int x, int y) {
  if (x == N && y == N) return;
  if (R[x + 1] == x + 1 && C[y + 1] == y + 1) {
    solve(x + 1, y + 1);
    return;
  }
  int X = Pr[x + 1], Y = Pc[y + 1];
  vc[0][++top] = x + 1;
  vc[1][top] = Y;
  vc[2][top] = X;
  vc[3][top] = y + 1;
  swap(R[x + 1], R[X]);
  swap(C[y + 1], C[Y]);
  swap(Pr[R[x + 1]], Pr[R[X]]);
  swap(Pc[C[y + 1]], Pc[C[Y]]);
  solve(x + 1, y + 1);
  return;
}
int main() {
  N = read();
  for (int i = 1; i <= N; i++) R[i] = read(), Pr[R[i]] = i;
  for (int i = 1; i <= N; i++) C[i] = read(), Pc[C[i]] = i;
  solve(0, 0);
  printf("%d\n", top);
  for (int i = 1; i <= top; i++) {
    for (int j = 0; j < 4; j++) printf("%d ", vc[j][i]);
    printf("\n");
  }
  return 0;
}
