#include <bits/stdc++.h>
using namespace std;
struct node {
  int y1, x1;
  int y2, x2;
  node(int yy1, int xx1, int yy2, int xx2)
      : y1(yy1), x1(xx1), y2(yy2), x2(xx2) {}
};
int m[3000];
int s[100];
vector<node> o;
void work(int i, int &y, int &x) {
  x = i;
  y = 1;
  while (x > s[y]) {
    x -= s[y];
    y++;
  }
}
void SWAP(int i, int j) {
  int x1, y1, x2, y2;
  swap(m[i], m[j]);
  work(i, y1, x1);
  work(j, y2, x2);
  o.push_back(node(y1, x1, y2, x2));
}
int main() {
  int N;
  cin >> N;
  int all = 0;
  for (int i = 1; i <= N; i++) {
    cin >> s[i];
    all += s[i];
  }
  for (int i = 1; i <= all; i++) cin >> m[i];
  for (int i = 1; i < all; i++) {
    int MIN = m[i];
    int MINN = i;
    for (int j = i + 1; j <= all; j++)
      if (m[j] < MIN) {
        MIN = m[j];
        MINN = j;
      }
    if (MINN != i) SWAP(i, MINN);
  }
  cout << o.size() << endl;
  for (vector<node>::iterator k = o.begin(); k != o.end(); k++) {
    cout << k->y1 << " " << k->x1 << " ";
    cout << k->y2 << " " << k->x2 << endl;
  }
}
