#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n, k, a[N], b[N], fin[N], res, ans;
const int inf = 0x3f3f3f3f;
queue<int> A, B;
int main() {
  scanf("%d%d", &n, &k);
  int mx = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]), mx = max(a[i], mx);
  }
  ans = inf;
  for (int beg = 1; beg <= mx; ++beg) {
    res = 0;
    for (int i = 1, j = beg; i <= n; ++i, j += k) {
      b[i] = j - a[i];
      if (b[i]) ++res;
    }
    if (res < ans) {
      ans = res;
      for (int j = 1; j <= n; ++j) fin[j] = b[j];
    }
  }
  printf("%d\n", ans);
  for (int i = 1; i <= n; ++i)
    if (fin[i] > 0)
      printf("+ %d %d\n", i, fin[i]);
    else if (fin[i] < 0)
      printf("- %d %d\n", i, -fin[i]);
  return 0;
}
