#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int arr[1020];
  int n, k;
  scanf("%d", &n);
  scanf("%d", &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &arr[i]);
  }
  int mini = 1000000000;
  int remember = -1;
  for (int i = 0; i < n; i++) {
    if (arr[i] - k * (i) > 0) {
      int coba = 0;
      for (int j = 0; j < n; j++) {
        if (arr[j] != arr[i] - k * (i - j)) coba++;
      }
      if (mini > coba) {
        mini = coba;
        remember = i;
      }
    }
  }
  printf("%d\n", mini);
  for (int i = 0; i < n; i++) {
    int seharusnya = arr[remember] - k * (remember - i);
    if (arr[i] < seharusnya) {
      printf("+ %d %d\n", i + 1, seharusnya - arr[i]);
    } else if (arr[i] > seharusnya) {
      printf("- %d %d\n", i + 1, arr[i] - seharusnya);
    }
  }
  return 0;
}
