#include <bits/stdc++.h>
using namespace std;
inline void readi(int &x);
const int maxn = 70005;
int n, m, s, mi, con[maxn];
vector<int> v[maxn];
int f[maxn], a[maxn];
int main() {
  readi(n), readi(s);
  for (int i = 1; i <= n; i++)
    readi(a[i]), m = max(m, a[i]), v[a[i]].push_back(i);
  if (s < m) {
    printf("-1\n");
    return 0;
  }
  s -= m;
  mi = v[m].back();
  v[m].pop_back();
  f[0] = 1;
  for (int t = 1; t <= m && !f[s]; t++)
    if (!v[t].empty())
      for (int j = s - t; j >= 0; j--)
        if (f[j])
          for (int k = v[t].size(), i = j + t; k-- && i <= s && !f[i]; i += t)
            f[i] = t;
  if (!f[s]) {
    printf("-1\n");
    return 0;
  }
  while (s > 0) {
    v[f[s]].pop_back();
    s -= f[s];
  }
  int p = 0;
  for (int i = 1; i <= m; i++) {
    if (i >= maxn) return 0;
    for (vector<int>::iterator it = v[i].begin(); it != v[i].end(); it++) {
      con[*it] = p;
      p = *it;
    }
  }
  con[mi] = p;
  for (int i = 1; i <= n; i++) {
    printf("%d", a[i] - a[con[i]]);
    if (con[i])
      printf(" 1 %d\n", con[i]);
    else
      printf(" 0\n");
  }
  return 0;
}
inline void readi(int &x) {
  char c;
  for (c = getchar(); c > '9' || c < '0'; c = getchar())
    ;
  x = c ^ '0';
  for (c = getchar(); c >= '0' && c <= '9'; c = getchar())
    x = x * 10 + (c ^ '0');
}
