#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, k, a, b;
  long count = 0;
  cin >> n >> k >> a;
  for (int i = 0; i < n; i++) {
    cin >> b;
    if (abs(a - b) <= k) {
      count++;
      cout << a << "-" << b << " " << abs(a - b) << endl;
      a = b;
    }
  }
  cout << count << endl;
}
