#include <bits/stdc++.h>
using namespace std;
int n, s;
vector<int> f[800000];
int a[800000];
int fst[800000], ans[800000];
int main() {
  int b;
  int maxx = 0;
  cin >> n >> s;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    f[a[i]].push_back(i);
    maxx = max(a[i], maxx);
  }
  if (maxx > s) {
    cout << -1 << endl;
    return 0;
  }
  b = f[maxx].back();
  s -= maxx;
  f[maxx].pop_back();
  a[0] = 0;
  fst[0] = 1;
  for (int i = 1; i <= maxx && !fst[s]; i++) {
    if (f[i].empty()) continue;
    for (int j = s - i; j >= 0; j--) {
      if (fst[j]) {
        for (int k = f[i].size(), m = j + i; k > 0 && m <= s && !fst[m];
             --k, m += i)
          fst[m] = i;
      }
    }
  }
  if (!fst[s]) {
    cout << -1 << endl;
    return 0;
  }
  while (s > 0) {
    f[fst[s]].pop_back();
    s -= fst[s];
  }
  int pre = 0;
  for (int i = 1; i <= maxx; i++) {
    for (vector<int>::iterator it = f[i].begin(); it != f[i].end(); it++) {
      ans[*it] = pre;
      pre = *it;
    }
  }
  ans[b] = pre;
  for (int i = 1; i <= n; i++) {
    cout << a[i] - a[ans[i]];
    if (ans[i])
      cout << " 1 " << ans[i] << endl;
    else
      cout << " 0" << endl;
  }
  return 0;
}
