#include <bits/stdc++.h>
using namespace std;
int N, K, A[1010], ret = 1000, pos;
int main() {
  cin >> N >> K;
  for (int i = 0; i < N; i++) cin >> A[i];
  for (int i = 0; i < N; i++) {
    int cnt = 0;
    for (int j = 0; j < N; j++)
      if (A[j] != A[i] + (j - i) * K) cnt++;
    if (cnt < ret && A[i] - i * K > 0) {
      ret = cnt;
      pos = i;
    }
  }
  cout << ret << endl;
  for (int i = 0; i < N; i++) {
    int h = A[pos] + (i - pos) * K;
    if (A[i] < h) cout << "+ " << i + 1 << " " << h - A[i] << endl;
    if (A[i] > h) cout << "- " << i + 1 << " " << A[i] - h << endl;
  }
  return 0;
}
