#include <bits/stdc++.h>
using namespace std;
int n, k, a[1002], now, ans, ansum;
int main() {
  ans = 0x3f3f3f3f;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= 1000; i++) {
    now = 0;
    for (int j = 1; j <= n; j++)
      if (a[j] != i + (j - 1) * k) now++;
    if (now < ans) {
      ans = now;
      ansum = i;
    }
  }
  printf("%d\n", ans);
  for (int i = 1; i <= n; i++)
    if (a[i] != ansum + (i - 1) * k)
      a[i] < ansum + (i - 1) * k
          ? printf("+ %d %d\n", i, ansum + (i - 1) * k - a[i])
          : printf("- %d %d\n", i, a[i] - ansum - (i - 1) * k);
  return 0;
}
