#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int a[2005];
int b[2005];
int main() {
  int n, k;
  while (cin >> n >> k) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    int mmin = n + 5, wh = 0;
    int num = 0;
    for (int i = 1; i <= n; i++) {
      num = 0;
      if (a[i] - (i - 1) * k < 1) continue;
      b[i] = a[i];
      for (int j = i - 1; j >= 1; j--) {
        b[j] = b[j + 1] - k;
        if (b[j] != a[j]) num++;
      }
      for (int j = i + 1; j <= n; j++) {
        b[j] = b[j - 1] + k;
        if (b[j] != a[j]) num++;
      }
      if (num < mmin) {
        mmin = num;
        wh = i;
      }
    }
    printf("%d\n", mmin);
    b[wh] = a[wh];
    for (int j = wh - 1; j >= 1; j--) {
      b[j] = b[j + 1] - k;
    }
    for (int j = wh + 1; j <= n; j++) {
      b[j] = b[j - 1] + k;
    }
    for (int i = 1; i <= n; i++) {
      if (b[i] > a[i])
        printf("+ %d %d\n", i, b[i] - a[i]);
      else if (b[i] < a[i])
        printf("- %d %d\n", i, -b[i] + a[i]);
    }
  }
  return 0;
}
