#include <bits/stdc++.h>
using namespace std;
struct ob {
  int x, y, z;
};
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  int r = 0;
  vector<ob> v(n + 1);
  int k = 0;
  for (int j = n - 1; j >= 0; j--) {
    if (((a[j] + r) % n) == j) {
      continue;
    } else {
      v[k].x = 1;
      v[k].y = j + 1;
      v[k].z = j - ((a[j] + r) % n);
      if (v[k].z < 0) v[k].z += n;
      r += v[k].z;
      k++;
    }
  }
  v[k].x = 2;
  v[k].y = n;
  v[k].z = n;
  k++;
  cout << k << endl;
  for (int i = 0; i < k; i++) {
    cout << v[i].x << " " << v[i].y << " " << v[i].z << endl;
  }
  return 0;
}
