#include <bits/stdc++.h>
using std::abs;
using std::array;
using std::cerr;
using std::cin;
using std::cout;
using std::generate;
using std::get;
using std::make_pair;
using std::make_tuple;
using std::map;
using std::max;
using std::max_element;
using std::min;
using std::min_element;
using std::pair;
using std::reverse;
using std::set;
using std::sort;
using std::string;
using std::swap;
using std::tuple;
using std::unique;
using std::vector;
template <typename T>
T input() {
  T res;
  cin >> res;
  {};
  return res;
}
template <typename IT>
void input_seq(IT b, IT e) {
  std::generate(b, e,
                input<typename std::remove_reference<decltype(*b)>::type>);
}
int main() {
  std::iostream::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  vector<int> rr(n), cc(n);
  for (int i = 0; i != n; ++i) rr[i] = input<int>() - 1;
  for (int i = 0; i != n; ++i) cc[i] = input<int>() - 1;
  vector<tuple<int, int, int, int>> ans;
  for (int i = 0; i != n; ++i) {
    int r = std::find(rr.begin(), rr.end(), i) - rr.begin();
    int c = std::find(cc.begin(), cc.end(), i) - cc.begin();
    if (r == i and c == i) continue;
    ans.emplace_back(i + 1, c + 1, r + 1, i + 1);
    swap(rr[i], rr[r]);
    swap(cc[i], cc[c]);
  }
  cout << int((ans).size()) << "\n";
  for (auto& elem : ans)
    cout << get<0>(elem) << " " << get<1>(elem) << " " << get<2>(elem) << " "
         << get<3>(elem) << "\n";
  return 0;
}
