Problem: You're given an array a of length n. You can perform the following operations on it:

  * choose an index i (1 ≤ i ≤ n), an integer x (0 ≤ x ≤ 10^6), and replace a_j with a_j+x for all (1 ≤ j ≤ i), which means add x to all the elements in the prefix ending at i. 
  * choose an index i (1 ≤ i ≤ n), an integer x (1 ≤ x ≤ 10^6), and replace a_j with a_j \% x for all (1 ≤ j ≤ i), which means replace every element in the prefix ending at i with the remainder after dividing it by x. 



Can you make the array strictly increasing in no more than n+1 operations?

Input

The first line contains an integer n (1 ≤ n ≤ 2000), the number of elements in the array a.

The second line contains n space-separated integers a_1, a_2, ..., a_n (0 ≤ a_i ≤ 10^5), the elements of the array a.

Output

On the first line, print the number of operations you wish to perform. On the next lines, you should print the operations.

To print an adding operation, use the format "1 i x"; to print a modding operation, use the format "2 i x". If i or x don't satisfy the limitations above, or you use more than n+1 operations, you'll get wrong answer verdict.

Examples

Input

3
1 2 3


Output

0

Input

3
7 6 3


Output

2
1 1 1
2 2 4

Note

In the first sample, the array is already increasing so we don't need any operations.

In the second sample:

In the first step: the array becomes [8,6,3].

In the second step: the array becomes [0,2,3].

Solution (in CPP):

Solution:
#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;
  }
}