#include <bits/stdc++.h>
int a[1001], b[1001][1001];
int main() {
  int n, k, count, min, mini;
  while (~scanf("%d%d", &n, &k)) {
    min = 10000000;
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    memset(b, 0, sizeof(b));
    for (int i = 1; i <= n; i++) {
      count = 0;
      b[i][i] = a[i];
      for (int j = i - 1; j >= 1; j--) {
        if (b[i][j + 1] - a[j] == k) count--;
        count++;
        b[i][j] = b[i][j + 1] - k;
      }
      for (int j = i + 1; j <= n; j++) {
        if (a[j] - b[i][j - 1] == k) count--;
        count++;
        b[i][j] = b[i][j - 1] + k;
      }
      if (b[i][1] >= 1 && count < min) {
        min = count;
        mini = i;
      }
    }
    printf("%d\n", min);
    for (int j = 1; j <= n; j++)
      if (b[mini][j] < a[j])
        printf("- %d %d\n", j, a[j] - b[mini][j]);
      else if (b[mini][j] > a[j])
        printf("+ %d %d\n", j, b[mini][j] - a[j]);
  }
  return 0;
}
