#include <bits/stdc++.h>
using namespace std;
int a[1004], b[1004];
vector<pair<char, pair<int, int> > > v, sol;
int main() {
  std::ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    sol.push_back(make_pair('-', make_pair(1, 1)));
  }
  sol.push_back(make_pair('-', make_pair(1, 1)));
  for (b[1] = 1; b[1] <= 1000; ++b[1]) {
    v.clear();
    int x = b[1];
    if (a[1] > x)
      v.push_back(make_pair('-', make_pair(1, a[1] - x)));
    else if (a[1] != x)
      v.push_back(make_pair('+', make_pair(1, x - a[1])));
    for (int i = 2; i <= n; ++i) {
      int x = b[i - 1] + k;
      if (a[i] > x)
        v.push_back(make_pair('-', make_pair(i, a[i] - x)));
      else if (a[i] != x)
        v.push_back(make_pair('+', make_pair(i, x - a[i])));
      b[i] = x;
    }
    if (sol.size() > v.size()) {
      sol.clear();
      for (unsigned j = 0; j < v.size(); ++j) sol.push_back(v[j]);
    }
  }
  cout << sol.size() << "\n";
  for (unsigned i = 0; i < sol.size(); ++i)
    cout << sol[i].first << " " << sol[i].second.first << " "
         << sol[i].second.second << "\n";
  return 0;
}
