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