#include <bits/stdc++.h>
using namespace std;
int n, m, k, l, r, t, temp, cnt, ans, res, x, sum;
int a[1001];
int b[1001];
int main() {
  res = 1000000;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i <= 1000; i++) {
    b[0] = i;
    for (int j = 1; j < n; j++) {
      b[j] = b[j - 1] + k;
    }
    cnt = 0;
    for (int j = 0; j < n; j++) {
      if (a[j] != b[j]) cnt++;
    }
    if (cnt < res) {
      ans = i;
      res = cnt;
    }
  }
  cout << res << endl;
  b[0] = ans;
  for (int j = 1; j < n; j++) {
    b[j] = b[j - 1] + k;
  }
  for (int j = 0; j < n; j++) {
    if (a[j] > b[j]) {
      cout << "- " << j + 1 << " " << a[j] - b[j] << endl;
    }
    if (a[j] < b[j]) {
      cout << "+ " << j + 1 << " " << -(a[j] - b[j]) << endl;
    }
  }
  return 0;
}
