#include #include #include using namespace std; int main(){ std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int n; cin >> n; vector a(n); for(int i = 0; i < n; i++){ cin >> a[i]; } cout << 30 << endl; for(int i = 0; i < 30; i++){ int r = n, add = (1 << (29 - i)); for(int j = 0; j < n; j++){ if(a[j] >= add){ r = min(r, j); a[j] -= add; } } if(r == 0) cout << 1 << " " << n << " " << 0 << endl; else cout << 1 << " " << r << " " << add << endl; sort(a.begin(), a.end()); } }