#include <bits/stdc++.h>
using namespace std;
const int maxn = 1005;
int tree[maxn];
int n, k;
int i_b = 0;
int min_opr = 99999999;
int checktree(int i) {
  int t_opr = 0;
  int t_b = tree[i] - k * i;
  for (int i = 1; i <= n; i++)
    if (k * i + t_b != tree[i]) t_opr++;
  if (min_opr > t_opr && (k + t_b >= 1)) {
    min_opr = t_opr;
    i_b = t_b;
  }
  return t_opr;
}
int main() {
  memset(tree, 0, sizeof(tree));
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &tree[i]);
  }
  for (int i = 1; i <= n; i++) {
    checktree(i);
  }
  cout << min_opr << endl;
  for (int i = 1; i <= n; i++) {
    int dis = k * i + i_b - tree[i];
    if (dis < 0)
      cout << "- " << i << " " << abs(dis) << endl;
    else if (dis > 0)
      cout << "+ " << i << " " << abs(dis) << endl;
  }
}
