#include <bits/stdc++.h>
const int N = 1e3 + 5;
int n, k, a[N];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  int ans = n, st;
  for (int i = 1; i <= 1000; ++i) {
    int sum = 0;
    for (int x = i, j = 1; j <= n; ++j, x += k) sum += (a[j] != x);
    if (sum < ans) ans = sum, st = i;
  }
  printf("%d\n", ans);
  for (int x = st, i = 1; i <= n; ++i, x += k)
    if (x != a[i]) {
      printf("%c %d %d\n", x < a[i] ? '-' : '+', i, std::abs(a[i] - x));
    }
  return 0;
}
