#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int K; cin >> K; vector D(K); for(auto &d : D) cin >> d; sort(D.begin(),D.end()); int d0 = D.at(0); D.erase(D.begin()); vector S = {0,2}; vector> edge; edge = {{0,1,d0/2},{1,2,d0/2}}; int bring = d0/2,cent = 1; for(auto d : D){ S.push_back(cent+3); edge.push_back({cent,cent+2,d/2-bring}); edge.push_back({cent+2,cent+3,d/2}); cent += 2; bring = d/2; } cout << edge.size()+1 << "\n"; for(auto [u,v,w] : edge) cout << u+1 << " " << v+1 << " " << w << "\n"; cout << S.size() << "\n"; for(auto &s : S) cout << s+1 << " "; cout << endl; }