#include <bits/stdc++.h>
using namespace std;
vector<pair<char, pair<int, int> > > v;
int main() {
  int n, k;
  int ans = 100000000;
  vector<int> vec;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    int temp1;
    scanf("%d", &temp1);
    vec.push_back(temp1);
  }
  for (int i = 1; i < 1001; i++) {
    int temp = 0;
    vector<pair<char, pair<int, int> > > tem;
    for (int j = 0; j < n; j++) {
      int a;
      a = abs(vec[j] - (i + j * k));
      if (a != 0) {
        temp++;
        if (vec[j] > i + j * k) {
          tem.push_back(pair<char, pair<int, int> >(
              '-', pair<int, int>(j + 1, vec[j] - (i + j * k))));
        } else {
          tem.push_back(pair<char, pair<int, int> >(
              '+', pair<int, int>(j + 1, -vec[j] + i + j * k)));
        }
      }
    }
    if (temp < ans) {
      v.clear();
      ans = temp;
      for (int j = 0; j < tem.size(); j++) {
        v.push_back(tem[j]);
      }
    }
  }
  cout << ans << endl;
  for (int i = 0; i < v.size(); i++) {
    printf("%c %d %d\n", v[i].first, v[i].second.first, v[i].second.second);
  }
}
