#include <bits/stdc++.h>
using namespace std;
const int N = 23334;
int n, s, a[70010];
bitset<70010> dp;
bitset<70010> memo[N];
bool out[70010];
int K[70010], c[70010], in[70010];
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> n >> s;
  for (int i = 0; i < (n); i++) cin >> a[i];
  int m = *max_element(a, a + n);
  int ma;
  for (int i = 0; i < (n); i++)
    if (a[i] == m) {
      ma = i;
      a[i] = 0;
      break;
    }
  s -= m;
  if (s < 0) return cout << -1, 0;
  for (int b = (n + N - 1) / N - 1; b >= 0; b--) {
    dp.reset();
    dp[0] = 1;
    int from = b * N;
    int to = min(n, (b + 1) * N);
    for (int i = 0; i < (to); i++) {
      if (from <= i && i < to) {
        memo[i - from] = (dp << a[i]) & ~dp;
      }
      dp |= dp << a[i];
    }
    if (to == n && !dp[s]) return cout << -1, 0;
    for (int i = to - 1; i >= from; i--) {
      if (memo[i - from][s]) {
        out[i] = 1;
        s -= a[i];
      }
    }
  }
  a[ma] = m;
  for (int i = 0; i < (n); i++) c[i] = a[i];
  vector<pair<long long, long long> > v;
  for (int i = 0; i < (n); i++)
    if (!out[i]) {
      v.push_back(make_pair(-a[i], i));
    }
  sort(v.begin(), v.end());
  for (int i = 0; i < (((int)(v).size())); i++) v[i].first *= -1;
  for (int i = 0; i < (((int)(v).size())); i++) {
    int I = v[i].second;
    if (i == ((int)(v).size()) - 1) {
      K[I] = 0;
      c[I] = v[i].first;
    } else {
      K[I] = 1;
      c[I] = v[i].first - v[i + 1].first;
      in[I] = v[i + 1].second;
    }
  }
  for (int i = 0; i < (n); i++) {
    cout << c[i] << " " << K[i];
    for (int j = 0; j < (K[i]); j++) cout << " " << in[i] + 1;
    cout << endl;
  }
}
