#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  long long a[n];
  map<long long, long long> m;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  pair<long long, long long> fmax = {0, 0};
  for (auto i : m) {
    if (i.second > fmax.second) {
      fmax = i;
    }
  }
  cout << n - fmax.second << endl;
  long long num;
  for (long long i = 0; i < n; i++) {
    if (a[i] == fmax.first) {
      num = i;
      break;
    }
  }
  for (long long i = num - 1; i >= 0; i--) {
    if (a[i] > fmax.first)
      cout << 2 << " ";
    else
      cout << 1 << " ";
    cout << i + 1 << " " << i + 2 << " " << endl;
  }
  for (long long i = num + 1; i < n; i++) {
    if (a[i] == fmax.first) continue;
    if (a[i] > fmax.first)
      cout << 2 << " ";
    else
      cout << 1 << " ";
    cout << i + 1 << " " << i << " " << endl;
  }
}
