#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, k;
  cin >> n >> k;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  vector<pair<char, pair<int, int>>> ans;
  int l = 0;
  int mini = INT_MAX;
  for (int i = 1; i <= 1000; i++) {
    int cnt = 0;
    l = 0;
    vector<pair<char, pair<int, int>>> v;
    for (int j = 0; j < n; j++) {
      if (arr[j] != i + l * k) {
        if (arr[j] > i + l * k) {
          v.push_back({'-', {j + 1, arr[j] - i - l * k}});
        } else {
          v.push_back({'+', {j + 1, i + l * k - arr[j]}});
        }
        cnt++;
      }
      l++;
    }
    if (cnt < mini) {
      mini = cnt;
      ans = v;
    }
  }
  cout << mini << endl;
  for (int i = 0; i < ans.size(); i++) {
    cout << ans[i].first << " " << ans[i].second.first << " "
         << ans[i].second.second << endl;
  }
}
