#include <bits/stdc++.h>
using namespace std;
const int maxn = 1111;
int a[maxn], b[maxn];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int maxim = 0, num = -1;
  for (int i = 1; i <= n; i++) {
    b[i] = a[i];
    for (int j = 1; j <= n; j++) b[j] = a[i] + (j - i) * k;
    int kol = 0;
    for (int j = 1; j <= n; j++)
      if (a[j] == b[j]) kol++;
    if (b[1] > 0 && kol > maxim) {
      maxim = kol;
      num = i;
    }
  }
  cout << n - maxim << endl;
  for (int i = 1; i <= n; i++) {
    if (a[num] + (i - num) * k == a[i]) continue;
    if (a[num] + (i - num) * k > a[i])
      cout << "+ " << i << " " << -(a[i] - a[num] - (i - num) * k) << endl;
    else
      cout << "- " << i << " " << -(a[num] + (i - num) * k - a[i]) << endl;
  }
  cin >> n;
  return 0;
}
