#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7, INF = INT_MAX;
const long long LINF = LLONG_MAX;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, i, j, k, ans = INF, st;
  cin >> n >> k;
  int a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 1; i < 10001; i++) {
    int x = 0, z = i;
    for (j = 0; j < n; j++) {
      if (a[j] != z) x++;
      z += k;
    }
    if (ans > x) {
      ans = x;
      st = i;
    }
  }
  cout << ans << endl;
  for (i = 0; i < n; i++) {
    if (a[i] > st)
      cout << "-"
           << " " << i + 1 << " " << a[i] - st << endl;
    else if (a[i] < st)
      cout << "+"
           << " " << i + 1 << " " << st - a[i] << endl;
    st += k;
  }
}
