#include <bits/stdc++.h>
int n;
int A[1005], B[1005];
int P[1005], Q[1005];
int posP[1005], posQ[1005];
std::vector<std::pair<std::pair<int, int>, std::pair<int, int> > > V;
int main() {
  scanf("%d", &n);
  for (int i = 1, x; i <= n; i++) scanf("%d", &x), A[x] = i, P[i] = posP[i] = i;
  for (int i = 1, x; i <= n; i++) scanf("%d", &x), B[x] = i, Q[i] = posQ[i] = i;
  for (int i = 1; i <= n; i++) {
    if (P[i] == A[i] && Q[i] == B[i]) continue;
    V.push_back(std::make_pair(std::make_pair(posP[A[i]], i),
                               std::make_pair(i, posQ[B[i]])));
    posP[P[i]] = posP[A[i]], P[posP[A[i]]] = P[i];
    posQ[Q[i]] = posQ[B[i]], Q[posQ[B[i]]] = Q[i];
  }
  printf("%lu\n", V.size());
  for (std::vector<
           std::pair<std::pair<int, int>, std::pair<int, int> > >::iterator it =
           V.begin();
       it != V.end(); ++it)
    printf("%d %d %d %d\n", it->first.first, it->first.second, it->second.first,
           it->second.second);
}
