#include <bits/stdc++.h>
using namespace std;
int n, k;
int h[1001];
int p[1001];
int ans, pos;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &h[i]);
  ans = 999999;
  for (int i = 1; i <= n; i++) {
    int num = 0;
    p[i] = h[i];
    int l = i - 1;
    int r = i + 1;
    int key = 0;
    while (l > 0) {
      if (h[l] != p[l + 1] - k) num++;
      p[l] = p[l + 1] - k;
      if (p[l] <= 0) {
        key = 1;
        break;
      }
      l--;
    }
    if (key == 1) continue;
    while (r <= n) {
      if (h[r] != p[r - 1] + k) num++;
      p[r] = p[r - 1] + k;
      r++;
    }
    if (num < ans) {
      ans = num;
      pos = i;
    }
  }
  cout << ans << endl;
  for (int i = 1; i <= n; i++) {
    int high = h[pos] + (i - pos) * k;
    if (h[i] > high) {
      cout << "- " << i << " " << h[i] - high << endl;
    }
    if (h[i] < high) {
      cout << "+ " << i << " " << high - h[i] << endl;
    }
  }
  return 0;
}
