#include <bits/stdc++.h>
using namespace std;
int h[10000];
map<int, int> b;
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> h[i];
  int maxi = 0, bb = 0;
  for (int i = 1; i <= n; ++i) {
    int bbb = h[i] - i * k;
    if (1 * k + bbb <= 0) continue;
    int cnt = 0;
    for (int j = 1; j <= n; ++j)
      if (h[j] == j * k + bbb) ++cnt;
    if (cnt > maxi) maxi = cnt, bb = bbb;
  }
  cout << n - maxi << endl;
  for (int i = 1; i <= n; ++i)
    if (h[i] != k * i + bb) {
      if (h[i] > k * i + bb)
        cout << "- " << i << ' ' << h[i] - k * i - bb << endl;
      else
        cout << "+ " << i << ' ' << k * i + bb - h[i] << endl;
    }
  return 0;
}
