#include <bits/stdc++.h>
using namespace std;
int h[1010];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) scanf("%d", &h[i]);
  int ans = 1, de = 1, num = 1, su = 5000;
  for (int i = 1; i <= 1000; i++) {
    int w = i - k;
    de = num = 0;
    int j;
    for (j = 1; j <= n; j++) {
      w += k;
      if (w != h[j]) ++num;
      if (w > h[j]) ++de;
    }
    if (su > num) {
      ans = i;
      su = num;
    }
    if (de >= n) break;
  }
  int w = ans - k;
  int c;
  cout << su << endl;
  for (int i = 1; i <= n; i++) {
    w += k;
    c = w - h[i];
    if (c < 0) {
      c = 0 - c;
      cout << "- " << i << " " << c << endl;
    } else if (c > 0) {
      cout << "+ " << i << " " << c << endl;
    }
  }
}
