#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, ans = 10000000, a[1005], v = 0;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) {
    if (a[i] - i * k < 1) continue;
    int p = 0;
    for (int j = 0; j < n; j++) {
      int w;
      if (j > i)
        w = a[i] + (j - i) * k;
      else
        w = a[i] - (i - j) * k;
      if (w != a[j]) p++;
    }
    if (p < ans) ans = p, v = i;
  }
  printf("%d\n", ans);
  for (int i = 0; i < n; i++) {
    int w;
    if (i > v)
      w = a[v] + (i - v) * k;
    else
      w = a[v] - (v - i) * k;
    if (w > a[i]) printf("+ %d %d\n", i + 1, w - a[i]);
    if (w < a[i]) printf("- %d %d\n", i + 1, a[i] - w);
  }
  return 0;
}
