1. #include "bits/stdc++.h"
  2. // #pragma GCC optimize("O3,unroll-loops")
  3. // #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
  4. using namespace std;
  5. using ll = long long int;
  6. mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
  7.  
  8. int main()
  9. {
  10. ios::sync_with_stdio(false); cin.tie(0);
  11.  
  12. int n; cin >> n;
  13. vector<int> a(n+1);
  14. for (int i = 1; i <= n; ++i) cin >> a[i];
  15. struct op {
  16. vector<int> ind;
  17. int special, type;
  18. };
  19. vector<op> ops;
  20.  
  21. for (int i = 1; i <= 20; ++i) {
  22. int mx = 0;
  23. for (int j = 1; j <= n; ++j) mx = max(mx, a[j]);
  24. op cur; cur.type = -1;
  25. int mn = 1e9;
  26. for (int j = 1; j <= n; ++j) {
  27. if (a[j] >= (mx+1)/2) {
  28. cur.ind.push_back(j);
  29. if (a[j] < mn) {
  30. mn = a[j];
  31. cur.special = j;
  32. }
  33. }
  34. }
  35. for (int j = 1; j <= n; ++j) {
  36. if (a[j] >= mn) a[j] -= mn;
  37. }
  38. ops.push_back(cur);
  39. }
  40.  
  41. // for (int i = 1; i <= n; ++i) {
  42. // if (a[i] == 0) continue;
  43. // op cur;
  44. // cur.special = i;
  45. // cur.type = -1;
  46. // for (int j = i; j <= n; ++j) {
  47. // if (a[j] >= a[i]) {
  48. // a[j] -= a[i];
  49. // cur.ind.push_back(j);
  50. // }
  51. // }
  52. // ops.push_back(cur);
  53. // }
  54. cout << size(ops) << '\n';
  55. for (auto o : ops) {
  56. cout << size(o.ind) << '\n';
  57. for (int x : o.ind) cout << x << ' ';
  58. cout << '\n';
  59. if (o.type == 1) cout << "+ ";
  60. else cout << "- ";
  61. cout << o.special << '\n';
  62. }
  63. }