#include <bits/stdc++.h>
int fix[1001];
int change[1001];
int main() {
  int i, n, j, k, max = 0, min = 1001, in[1001], a, pos, expected, mins = 0;
  scanf("%d%d", &n, &k);
  for (i = 1; i <= n; i++) {
    scanf("%d", &in[i]);
    if (in[i] > max) {
      max = in[i];
    }
  }
  for (i = 1; i <= max; i++) {
    for (j = 1; j <= n; j++) {
      expected = i + ((j - 1) * k);
      if (in[j] != expected) {
        fix[i]++;
      }
    }
    if (fix[i] == 0) {
      a = i;
      min = 0;
      break;
    } else if (fix[i] < min) {
      min = fix[i];
      a = i;
    }
  }
  for (i = 1; i <= n; i++) {
    expected = a + ((i - 1) * k);
    if (in[i] != expected) {
      change[i] = expected - in[i];
      mins++;
    }
  }
  printf("%d\n", mins);
  for (i = 1; i < 1001; i++) {
    if (change[i] > 0) {
      printf("+ %d %d\n", i, change[i]);
    } else if (change[i] < 0) {
      printf("- %d %d\n", i, (change[i] * -1));
    }
  }
}
