#include <bits/stdc++.h>
using namespace std;
int n, k, qd, a[1001], ansqd, anschange, js;
int main(int argc, char *argv[]) {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  anschange = 1000;
  for (qd = 1; qd <= 1000; qd++) {
    js = 0;
    for (int i = 1; i <= n; i++)
      if (a[i] != qd + (i - 1) * k) js++;
    if (js < anschange) {
      anschange = js;
      ansqd = qd;
    }
  }
  printf("%d\n", anschange);
  for (int i = 1; i <= n; i++) {
    if (a[i] < ansqd + (i - 1) * k)
      printf("+ %d %d\n", i, ansqd + (i - 1) * k - a[i]);
    else if (a[i] > ansqd + (i - 1) * k)
      printf("- %d %d\n", i, a[i] - ansqd - (i - 1) * k);
  }
  return 0;
}
