#include <bits/stdc++.h>
using namespace std;
template <typename tp>
inline void read(tp& x) {
  x = 0;
  char tmp;
  bool key = 0;
  for (tmp = getchar(); !isdigit(tmp); tmp = getchar()) key = (tmp == '-');
  for (; isdigit(tmp); tmp = getchar()) x = (x << 3) + (x << 1) + (tmp ^ '0');
  if (key) x = -x;
}
template <typename tp>
inline void ckmn(tp& x, tp y) {
  x = x < y ? x : y;
}
template <typename tp>
inline void ckmx(tp& x, tp y) {
  x = x < y ? y : x;
}
const int N = 1010;
vector<pair<pair<int, int>, pair<int, int> > > ans;
int n, p1[N], p2[N], o1[N], o2[N];
int main() {
  read(n);
  for (int i = (1); i <= (n); ++i) read(p1[i]);
  for (int i = (1); i <= (n); ++i) read(p2[i]);
  for (int i = (n); i >= (1); --i) {
    int p = i;
    for (int j = (1); j <= (i - 1); ++j)
      if (p1[j] == i) p = j;
    o1[i] = p;
    if (p != i) swap(p1[i], p1[p]);
  }
  for (int i = (n); i >= (1); --i) {
    int p = i;
    for (int j = (1); j <= (i - 1); ++j)
      if (p2[j] == i) p = j;
    o2[i] = p;
    if (p != i) swap(p2[i], p2[p]);
  }
  for (int i = (2); i <= (n); ++i) {
    if (o1[i] == i && o2[i] == i) continue;
    ans.push_back(pair<pair<int, int>, pair<int, int> >(
        pair<int, int>(p1[o1[i]], i), pair<int, int>(i, p2[o2[i]])));
    swap(p1[i], p1[o1[i]]);
    swap(p2[i], p2[o2[i]]);
  }
  printf("%d\n", (int)ans.size());
  for (int i = (0); i <= ((int)ans.size() - 1); ++i)
    printf("%d %d %d %d\n", ans[i].first.first, ans[i].first.second,
           ans[i].second.first, ans[i].second.second);
  return 0;
}
