#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1010;
int a[MAXN], n, k;
int check(int x, bool print = false) {
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (abs(a[i] - i * k - x) > 0) ans++;
    if (print) {
      if (a[i] == i * k + x) continue;
      if (a[i] < i * k + x)
        cout << '+' << ' ' << i + 1 << ' ' << abs(a[i] - i * k - x) << '\n';
      else
        cout << '-' << ' ' << i + 1 << ' ' << abs(a[i] - i * k - x) << '\n';
    }
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  int ans = 1e+6, l = 0;
  for (int i = 1; i < MAXN; i++) {
    if (check(i) < ans) l = i;
    ans = min(ans, check(i));
  }
  cout << ans << endl;
  check(l, 1);
}
