#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 6;
vector<pair<long long, pair<long long, long long>>> ans;
long long ar[N];
map<long long, long long> m;
void solve_left(long long l, long long r) {
  for (long long i = r - 1; i >= l; --i) {
    if (ar[i] == ar[i + 1]) continue;
    if (ar[i] > ar[i + 1]) {
      ar[i] = ar[i] - abs(ar[i] - ar[i + 1]);
      ans.push_back({2, {i, i + 1}});
    } else {
      ar[i] = ar[i] + abs(ar[i] - ar[i + 1]);
      ans.push_back({1, {i, i + 1}});
    }
  }
}
void solve_right(long long l, long long r) {
  for (long long i = l + 1; i <= r; ++i) {
    if (ar[i] == ar[i - 1]) continue;
    if (ar[i] > ar[i - 1]) {
      ar[i] = ar[i] - abs(ar[i] - ar[i - 1]);
      ans.push_back({2, {i, i - 1}});
    } else {
      ar[i] = ar[i] + abs(ar[i] - ar[i - 1]);
      ans.push_back({1, {i, i - 1}});
    }
  }
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i <= n - 1; ++i) {
    cin >> ar[i];
    m[ar[i]]++;
  }
  long long cnt = 0, target = 0;
  for (auto x : m) {
    if (x.second > cnt) {
      target = x.first;
      cnt = x.second;
    }
  }
  for (long long i = 0; i <= n - 1; ++i) {
    if (ar[i] == target) {
      solve_left(0, i);
      solve_right(i, n - 1);
      break;
    }
  }
  cout << ans.size() << endl;
  for (auto x : ans) {
    cout << x.first << " " << x.second.first + 1 << " " << x.second.second + 1
         << endl;
  }
  return 0;
}
