#include <bits/stdc++.h>
using namespace std;
const int maxn = 70 * 1000 + 10;
int n, s, cnt;
bool mark[maxn];
pair<int, int> a[maxn];
int dp[maxn], child[maxn], tmp_a[maxn], c[maxn];
int main() {
  scanf("%d %d", &n, &s);
  for (int i = 1; i <= n; i++) {
    a[i].second = i;
    scanf("%d", &a[i].first);
    tmp_a[i] = a[i].first;
  }
  sort(a + 1, a + n + 1);
  if (s < a[n].first) {
    printf("-1");
    return 0;
  }
  memset(dp, -1, sizeof dp);
  dp[0] = 0;
  int tmp0_s = s - a[n].first, sum = 0;
  for (int i = 1; i < n; i++) {
    sum += a[i].first;
    for (int j = min(tmp0_s, sum); j >= a[i].first; j--) {
      if (dp[j] < 0 && dp[j - a[i].first] >= 0) dp[j] = i;
    }
    if (dp[tmp0_s] >= 0) break;
  }
  if (dp[tmp0_s] < 0) {
    printf("-1");
    return 0;
  }
  int tmp1_s = tmp0_s;
  while (dp[tmp1_s] > 0) {
    cnt++;
    mark[dp[tmp1_s]] = true;
    tmp1_s -= a[dp[tmp1_s]].first;
  }
  if (cnt == n - 1) {
    for (int i = 1; i <= n; i++) printf("%d 0\n", tmp_a[i]);
    return 0;
  }
  for (int i = n; i > 1; i--) {
    if (mark[i - 1]) continue;
    child[a[i].second] = a[i - 1].second;
    c[a[i].second] = tmp_a[a[i].second] - a[i - 1].first;
  }
  for (int i = 1; i <= n; i++) {
    if (child[i] == 0)
      printf("%d 0\n", tmp_a[i]);
    else
      printf("%d 1 %d\n", c[i], child[i]);
  }
  return 0;
}
