#include <bits/stdc++.h>
using namespace std;
int a[2000], n, k, ans, cnt, p;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = (1); i <= (n); ++i) scanf("%d", &a[i]);
  ans = 1e9;
  for (int i = (1); i <= (1000); ++i) {
    cnt = 0;
    for (int j = (1); j <= (n); ++j)
      if (a[j] != i + (j - 1) * k) ++cnt;
    if (cnt < ans) ans = cnt, p = i;
  }
  printf("%d\n", ans);
  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, p + (i - 1) * k - a[i]);
      else
        printf("- %d %d\n", i, a[i] - p - (i - 1) * k);
    }
  return 0;
}
