#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k;
  int n, m;
  int sum, x;
  scanf("%d%d", &n, &k);
  int a[n];
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  int cnt;
  m = 10001;
  for (i = 1; i <= 1000; i++) {
    sum = i;
    cnt = 0;
    for (j = 0; j < n; j++) {
      if (a[j] != sum) cnt++;
      sum += k;
    }
    if (cnt < m) m = cnt, x = i;
  }
  printf("%d", m), printf("\n");
  for (i = 0; i < n; i++) {
    if (x > a[i])
      cout << "+ " << i + 1 << " " << x - a[i] << endl;
    else if (a[i] > x)
      cout << "- " << i + 1 << " " << a[i] - x << endl;
    x += k;
  }
  return 0;
}
