#include <bits/stdc++.h>
using namespace std;
long long int inf = 1e18;
long long int expo(long long int x, long long int y) {
  long long int ans = 1;
  while (y != 0) {
    if (y % 2) {
      ans = ans * x;
    }
    y = y >> 1;
    x = x * x;
  }
  return ans;
}
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long int lcm(long long int a, long long int b) {
  return (a * b) / gcd(a, b);
}
long long int max(long long int x, long long int y) {
  if (x > y) return x;
  return y;
}
long long int min(long long int x, long long int y) {
  if (x < y) return x;
  return y;
}
vector<long long int> SieveOfEratosthenes(long long int n) {
  vector<long long int> primes;
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (long long int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long int p = 2; p <= n; p++)
    if (prime[p]) primes.push_back(p);
  return primes;
}
vector<long long int> getDivisors(long long int num) {
  vector<long long int> divisors;
  for (long long int i = 1; i * i <= num; i++) {
    if (!(num % i)) {
      if (i * i == num)
        divisors.push_back(i);
      else {
        divisors.push_back(i);
        divisors.push_back(num / i);
      }
    }
  }
  sort(divisors.begin(), divisors.end());
  return divisors;
}
void displayVector(vector<long long int> vect) {
  for (long long int i = 0; i < vect.size(); i++) cout << vect[i] << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> arr(n);
  for (long long int i = 0; i < n; i++) cin >> arr[i];
  long long int num = arr.size();
  long long int cnt = 0;
  vector<pair<long long int, pair<long long int, long long int>>> operations;
  long long int sum = 0;
  long long int addend = 0;
  for (long long int i = arr.size() - 1; i >= 0; i--) {
    addend = 0;
    arr[i] += sum;
    if ((arr[i]) % num == i)
      continue;
    else {
      if ((arr[i] % num) < i) {
        cnt++;
        operations.push_back({1, {i + 1, (i - (arr[i] % num))}});
        addend += (i - (arr[i] % num));
      } else {
        cnt++;
        operations.push_back({1, {i + 1, (num - arr[i] % num + i)}});
        addend += (num - arr[i] % num + i);
      }
    }
    arr[i] += addend;
    sum += addend;
  }
  cnt++;
  operations.push_back({2, {arr.size(), num}});
  cout << cnt << endl;
  for (long long int i = 0; i < operations.size(); i++) {
    cout << operations[i].first << " " << operations[i].second.first << " "
         << operations[i].second.second << endl;
  }
}
