#include <bits/stdc++.h>
using namespace std;
template <class X>
void input(vector<X>& a, int N) {
  X temp;
  for (unsigned long long int i = 0; i < N; i++) {
    cin >> temp;
    a.push_back(temp);
  }
}
void solve() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (unsigned long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<int> diff(n, 0);
  for (unsigned long long int i = 0; i < n; i++) {
    int start = a[i] - i * k;
    if (start <= 0) {
      for (unsigned long long int j = 0; j < n; j++) {
        diff[j]++;
      }
      continue;
    }
    for (unsigned long long int j = 0; j < n; j++) {
      if (a[j] != start + j * k) {
        diff[j]++;
      }
    }
  }
  int t = min_element(diff.begin(), diff.end()) - diff.begin();
  cout << diff[t] << '\n';
  int start = a[t] - k * t;
  for (unsigned long long int i = 0; i < n; i++) {
    if (a[i] != start + i * k) {
      if (a[i] < start + i * k) {
        cout << "+ " << i + 1 << " " << start + i * k - a[i] << '\n';
      } else {
        cout << "- " << i + 1 << " " << a[i] - start - i * k << '\n';
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
