#include <bits/stdc++.h>
using namespace std;
int q[1005], w[1005];
int main() {
  int n, k;
  int mmx = 10000;
  int i, j;
  int mm = 0;
  memset(q, 0, sizeof(q));
  memset(w, 0, sizeof(w));
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &q[i]);
  }
  for (i = 0; i < n; i++) {
    if ((q[i] - i * k) > 0 && (q[i] + (n - i - 1) * k) > 0) {
      for (j = 0; j < n; j++) {
        if (q[j] != (q[i] + (j - i) * k)) {
          w[i]++;
        }
      }
      if (mmx > w[i]) {
        mmx = w[i];
        mm = i;
      }
    }
  }
  if (w[mm] == 0) {
    printf("0");
  } else {
    printf("%d\n", w[mm]);
    for (i = 0; i < n; i++) {
      int h = q[mm] + (i - mm) * k - q[i];
      if (h > 0) printf("+ %d %d\n", i + 1, h);
      if (h < 0) printf("- %d %d\n", i + 1, -h);
    }
  }
  return 0;
}
