#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, i;
  long long int val, count = 0, j, min, minpos;
  cin >> n >> k;
  int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 1; i <= 1000; i++) {
    val = i;
    count = 0;
    for (j = 0; j < n; j++) {
      if (a[j] != val) count++;
      val += k;
    }
    if (i == 0) {
      min = count;
      minpos = i;
    } else {
      if (count < min) {
        min = count;
        minpos = i;
      }
    }
  }
  cout << min << "\n";
  val = minpos;
  for (i = 0; i < n; i++) {
    if (a[i] > val)
      cout << "- " << i + 1 << " " << abs(a[i] - val) << "\n";
    else if (a[i] < val)
      cout << "+ " << i + 1 << " " << abs(a[i] - val) << "\n";
    val += k;
  }
  return 0;
}
