#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  int n, k;
  cin >> n >> k;
  int a[n + 1], b[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int mn = (int)1e9 + 7, mni = -1;
  for (int i = 1; i <= 100000; i++) {
    int cnt = 0;
    b[1] = i;
    for (int j = 2; j <= n; j++) {
      b[j] = b[j - 1] + k;
    }
    for (int j = 1; j <= n; j++) {
      if (a[j] != b[j]) cnt++;
    }
    if (cnt < mn) {
      mn = cnt;
      mni = i;
    }
  }
  cout << mn << endl;
  b[1] = mni;
  for (int j = 2; j <= n; j++) {
    b[j] = b[j - 1] + k;
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] == b[i])
      continue;
    else if (a[i] > b[i]) {
      cout << "- " << i << " " << a[i] - b[i];
    } else
      cout << "+ " << i << " " << b[i] - a[i];
    cout << endl;
  }
  return 0;
}
