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