#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[1009], mn = 1000, b[1009];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  int ix = 0;
  for (int i = 0; i < n; i++) {
    int m = 0;
    if (a[i] - k * i > 0) {
      for (int j = 0; j < n; j++) {
        if (j < i) {
          if (a[i] - a[j] != k * (i - j)) {
            m++;
          }
        } else {
          if (j > i)
            if (a[j] - a[i] != k * (j - i)) {
              m++;
            }
        }
      }
      if (m <= mn) ix = i, mn = m;
    }
  }
  cout << mn << endl;
  for (int i = ix + 1; i < n; i++) {
    b[i] = b[i - 1] + k;
  }
  for (int i = ix - 1; i > -1; i--) {
    b[i] = b[i + 1] - k;
  }
  for (int i = 0; i < n; i++) {
    if (a[i] < b[i])
      cout << "+ " << i + 1 << ' ' << b[i] - a[i] << endl;
    else if (a[i] > b[i])
      cout << "- " << i + 1 << ' ' << a[i] - b[i] << endl;
  }
}
