#include <bits/stdc++.h>
int arr[10001], brr[10001], crr[10001];
using namespace std;
int main() {
  int i, j, pos, count, k, n, mini_moves;
  scanf("%d%d", &n, &k);
  for (i = 0; i < n; ++i) scanf("%d", arr + i);
  mini_moves = 100000;
  count = 0;
  pos = 0;
  for (i = 0; i < n; ++i) {
    brr[i] = arr[i];
    for (j = i - 1; j >= 0; j--) brr[j] = brr[j + 1] - k;
    for (j = i + 1; j < n; ++j) brr[j] = brr[j - 1] + k;
    for (j = 0; j < n; ++j)
      if (brr[j] <= 0) break;
    if (j != n) continue;
    for (j = 0; j < n; ++j) crr[j] = arr[j] - brr[j];
    count = 0;
    for (j = 0; j < n; ++j) {
      if (crr[j] != 0) count++;
    }
    if (count < mini_moves) {
      mini_moves = count;
      pos = i;
    }
  }
  brr[pos] = arr[pos];
  for (j = pos + 1; j < n; ++j) brr[j] = brr[j - 1] + k;
  for (j = pos - 1; j >= 0; j--) {
    brr[j] = brr[j + 1] - k;
  }
  for (j = 0; j < n; ++j) crr[j] = arr[j] - brr[j];
  printf("%d\n", mini_moves);
  for (j = 0; j < n; ++j) {
    if (crr[j] != 0) {
      if (crr[j] > 0) {
        printf("- %d %d\n", j + 1, crr[j]);
      } else
        printf("+ %d %d\n", j + 1, -1 * crr[j]);
    }
  }
  return 0;
}
