#include <bits/stdc++.h>
using namespace std;
const int maxN = 2222;
int a[maxN], n, k;
int f(int num) {
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    int cur = a[num] - (num - i) * k;
    if (cur <= 0) ans = -n;
    if (cur == a[i]) ++ans;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int num = 0, ans = 0;
  for (int i = 1; i <= n; ++i) {
    int cur = f(i);
    if (cur > ans) ans = cur, num = i;
  }
  cout << n - ans << endl;
  for (int i = 1; i <= n; ++i) {
    int cur = a[num] - (num - i) * k;
    if (cur < a[i]) cout << "- " << i << " " << a[i] - cur << endl;
    if (cur > a[i]) cout << "+ " << i << " " << -a[i] + cur << endl;
  }
  return 0;
}
