#include <bits/stdc++.h>
using namespace std;
int aa[2005];
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    cin >> aa[i];
  }
  int minx = 2005;
  int best = 0;
  for (int i = 0; i < n; ++i) {
    int tmp = 0;
    int can = 1;
    for (int t = 0; t < i; ++t) {
      if (aa[t] != aa[i] - (i - t) * k) tmp++;
      if ((aa[i] - (i - t) * k) <= 0) {
        can = 0;
        break;
      }
    }
    if (!can) continue;
    for (int t = i + 1; t < n; ++t) {
      if (aa[t] != aa[i] + (t - i) * k) tmp++;
    }
    if (tmp < minx) {
      minx = tmp;
      best = i;
      if (minx == 0) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  cout << minx << endl;
  for (int i = 0; i < n; ++i) {
    int tar = aa[best] + (i - best) * k;
    if (aa[i] < tar) {
      cout << '+' << ' ';
      cout << i + 1 << ' ' << tar - aa[i] << endl;
    } else if (aa[i] > tar) {
      cout << '-' << ' ' << i + 1 << ' ' << aa[i] - tar << endl;
    }
  }
  return 0;
}
