#include <bits/stdc++.h>
using namespace std;
int n, s;
struct node {
  int v, id;
  bool operator<(node const &ano) const { return v < ano.v; }
} A[70010];
int dp[2270];
int pow_2[32];
int move_L(int a, int b) {
  a &= pow_2[31 - b] - 1;
  return a << b;
}
int save(int a) { return (dp[a / 31] & (1 << (30 - a % 31))) > 0; }
vector<int> q;
int last[70010];
int lowbit(int a) { return a & (-a); }
void record(int id, int p, int s) {
  for (; s; s -= lowbit(s)) last[30 - (int)log2(lowbit(s)) + p * 31] = id;
}
int mark[70010], B[70010], ans[70010];
int main() {
  for (int i = 0; i < 32; ++i) pow_2[i] = 1 << i;
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; ++i) scanf("%d", &A[i].v), A[i].id = i, B[i] = A[i].v;
  sort(A + 1, A + n + 1);
  s -= A[n].v;
  int s0 = s;
  --n;
  dp[0] = 1 << 30;
  for (int i = 1; i <= n; ++i) {
    for (int j = 2270 - 1; j >= 0; --j)
      if (j * 31 + A[i].v <= s) {
        int l = j * 31 + A[i].v, r = j * 31 + 30 + A[i].v;
        int t = dp[j];
        int lp;
        lp = dp[l / 31], dp[l / 31] |= t >> (l % 31);
        record(i, l / 31, lp ^ dp[l / 31]);
        lp = dp[r / 31];
        if (l / 31 != r / 31) dp[r / 31] |= move_L(t, 30 - r % 31);
        record(i, r / 31, lp ^ dp[r / 31]);
      }
  }
  if (!save(s)) {
    printf("-1\n");
    return 0;
  }
  for (; s0; s0 -= A[last[s0]].v) mark[last[s0]] = 1;
  int la = 0;
  for (int i = 1; i <= n + 1; ++i)
    if (!mark[i]) {
      ans[A[i].id] = la;
      la = A[i].id;
    }
  for (int i = 1; i <= n + 1; ++i) {
    if (!ans[i])
      printf("%d %d\n", B[i], 0);
    else
      printf("%d %d %d\n", B[i] - B[ans[i]], 1, ans[i]);
  }
  return 0;
}
