#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int n, s;
bool vst[70005];
vector<int> son[70005];
struct node {
  int v, pos;
} a[70005];
bitset<70005> e[700], tmp, f[100];
inline bool cmp(node aa, node bb) { return aa.v < bb.v; }
void find(int x, int y) {
  if (!x) return;
  int las = (x - 1) / 100, u = x - las * 100;
  f[0] = e[las];
  int i;
  for (i = 1; i < u; ++i) f[i] = f[i - 1] | (f[i - 1] << a[i + las * 100].v);
  if (!f[u - 1][y]) vst[x] = 1, y -= a[x].v;
  for (i = u - 1; i; --i)
    if (!f[i - 1][y]) vst[i + las * 100] = 1, y -= a[i + las * 100].v;
  find(las * 100, y);
}
int i, j, fir[70005], Tmp[70005], tot, val[70005];
int main() {
  cin >> n >> s;
  for (i = 1; i <= n; ++i) cin >> a[i].v, a[i].pos = i, fir[i] = a[i].v;
  sort(a + 1, a + n + 1, cmp);
  if (a[n].v > s) return cout << -1, 0;
  s -= a[n].v;
  e[0][0] = tmp[0] = 1;
  for (i = 1; i < n; ++i) {
    tmp |= tmp << a[i].v;
    if (i % 100 == 0) e[i / 100] = tmp;
  }
  if (!tmp[s]) return cout << -1, 0;
  find(n - 1, s);
  for (i = 1; i <= n; ++i) {
    if (!vst[i])
      Tmp[++tot] = a[i].pos;
    else
      val[a[i].pos] = a[i].v;
  }
  for (i = 1; i <= tot; ++i)
    son[Tmp[i + 1]].push_back(Tmp[i]),
        val[Tmp[i]] = fir[Tmp[i]] - fir[Tmp[i - 1]];
  for (i = 1; i <= n; ++i) {
    cout << val[i] << " " << son[i].size() << " ";
    for (j = 0; j < son[i].size(); ++j) cout << son[i][j] << " ";
    cout << "\n";
  }
}
