#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k, i, j;
  cin >> n;
  long long a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  vector<pair<long long, pair<long long, long long> > > v;
  long long r, x;
  if (a[n - 1] < n) {
    v.push_back(
        make_pair(1, pair<long long, long long>(n, n - (a[n - 1] % n))));
    for (j = 0; j < n; j++) a[j] += n - (a[n - 1]) % n;
  }
  r = a[n - 1];
  for (i = n - 1 - 1; i >= 0; i--) {
    r--;
    if ((a[i] % a[n - 1]) == r) continue;
    if (r > (a[i] % a[n - 1]))
      x = r - (a[i] % a[n - 1]);
    else
      x = a[n - 1] - (a[i] % a[n - 1]) + r;
    v.push_back(make_pair(1, pair<long long, long long>(i + 1, x)));
    for (j = 0; j < i + 1; j++) a[j] += x;
  }
  if (n != 1)
    v.push_back(make_pair(2, pair<long long, long long>(n - 1, a[n - 1])));
  cout << v.size() << "\n";
  for (i = 0; i < v.size(); i++)
    cout << v[i].first << " " << v[i].second.first << " " << v[i].second.second
         << "\n";
  return 0;
}
