#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n;
  cin >> k;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int start[1001] = {};
  for (int i = 0; i < n; i++) {
    if (a[i] - i * k > 0) start[a[i] - i * k]++;
  }
  int max = 0;
  for (int i = 0; i < 1001; i++) {
    if (start[i] > start[max]) max = i;
  }
  cout << n - start[max] << endl;
  for (int i = 0; i < n; i++) {
    if (a[i] - max > i * k)
      cout << "- " << i + 1 << " " << a[i] - max - i * k << endl;
    else if (a[i] - max < i * k)
      cout << "+ " << i + 1 << " " << (max + i * k) - a[i] << endl;
  }
  return 0;
}
