#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000 + 7;
const double esp = 1e-13;
int n, k, a[1000 + 10], cal, ans, vt;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  ans = INF;
  for (long long i = 1; i <= n; i++) {
    cal = 0;
    for (long long j = 1; j <= n; j++) {
      if (a[j] != a[i] + (j - i) * k) cal++;
      if (a[i] + (j - i) * k <= 0) goto loop;
    }
    if (ans > cal) {
      ans = cal;
      vt = i;
    }
  loop:;
  }
  cout << ans << "\n";
  for (long long i = 1; i <= n; i++)
    if (a[i] != a[vt] + (i - vt) * k) {
      if (a[i] > a[vt] + (i - vt) * k)
        cout << "- " << i << " " << a[i] - (a[vt] + (i - vt) * k) << "\n";
      else
        cout << "+ " << i << " " << (a[vt] + (i - vt) * k) - a[i] << "\n";
    }
}
