#include <bits/stdc++.h>
using namespace std;
int i, j, k, u, v, m, n, ma, ans = 9999999, ans1;
int a[5001] = {};
int main() {
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    ma = max(ma, a[i] + k);
  }
  for (i = 1; i <= ma; i++) {
    int s = 0;
    int m = i;
    for (j = 1; j <= n; j++) {
      if (a[j] != m) s++;
      m += k;
    }
    if (m < 0) continue;
    if (ans > s) {
      ans = s;
      ans1 = i;
    }
  }
  cout << ans << endl;
  if (ans)
    for (i = 1; i <= n; i++) {
      if (ans1 != a[i]) {
        if (a[i] < ans1)
          cout << "+" << i << " " << ans1 - a[i] << endl;
        else
          cout << "-" << i << " " << a[i] - ans1 << endl;
      }
      ans1 += k;
    }
  return 0;
}
