#include <bits/stdc++.h>
int main() {
  int n, k;
  int h[1001] = {0};
  scanf("%d%d", &n, &k);
  int i, j;
  for (i = 1; i <= n; i++) scanf("%d", &h[i]);
  int min = 9999999, nn = 1;
  for (i = 1; i <= n; i++) {
    if (h[i] < 1 + k * (i - 1)) continue;
    int ans = 0;
    for (j = 1; j <= n; j++)
      if (h[j] != h[i] + k * (j - i)) ans++;
    if (ans < min) {
      min = ans;
      nn = i;
    }
    if (min == 0) break;
  }
  printf("%d\n", min);
  for (i = 1; i <= n; i++) {
    if (h[i] > h[nn] + k * (i - nn))
      printf("- %d %d\n", i, h[i] - h[nn] - k * (i - nn));
    else if (h[i] < h[nn] + k * (i - nn))
      printf("+ %d %d\n", i, h[nn] + k * (i - nn) - h[i]);
  }
  return 0;
}
