#include <bits/stdc++.h>
using namespace std;
const int MX = 200005;
int N;
int rec[2000];
int arr[2000];
vector<pair<char, pair<int, int> > > v;
int main() {
  int inc;
  cin >> N >> inc;
  for (int i = 0; i < N; i++) cin >> arr[i];
  int MN = +1e9, ELEM_MN = 0;
  for (int ans = 1; ans <= 1000; ans++) {
    int cnt = 0;
    int poten = ans;
    for (int i = 0; i < N; i++) {
      if (arr[i] != poten) cnt++;
      poten += inc;
    }
    if (cnt < MN) MN = cnt, ELEM_MN = ans;
  }
  for (int i = 0; i < N; i++) {
    if (arr[i] == ELEM_MN) {
      ELEM_MN += inc;
      continue;
    }
    if (arr[i] > ELEM_MN)
      v.push_back(make_pair('-', make_pair(i + 1, arr[i] - ELEM_MN)));
    else
      v.push_back(make_pair('+', make_pair(i + 1, ELEM_MN - arr[i])));
    ELEM_MN += inc;
  }
  cout << v.size() << "\n";
  for (int i = 0; i < v.size(); i++)
    cout << v[i].first << " " << v[i].second.first << " " << v[i].second.second
         << "\n";
  return 0;
}
