#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > bags;
int parent[70010], coin[70010], taken[70010], contained_bags[70010];
int main() {
  int n, totalcoin, maxa = 0, maxbag;
  cin >> n >> totalcoin;
  bags.assign(70010, vector<int>());
  for (int i = 0; i < n; i++) {
    cin >> coin[i];
    bags[coin[i]].push_back(i);
    maxa = max(maxa, coin[i]);
  }
  maxbag = bags[maxa].back();
  bags[maxa].pop_back();
  int target = totalcoin - maxa;
  if (target < 0) {
    cout << -1 << endl;
    return 0;
  }
  memset(parent, -1, sizeof parent);
  parent[0] = 0;
  for (int i = 0; i <= maxa && parent[target] == -1; i++) {
    if (bags[i].size() == 0) {
      continue;
    }
    if (parent[i] == -1) {
    }
    for (int j = target - i; j >= 0; j--) {
      if (parent[j] != -1) {
        for (int k = i, l = 0; j + k <= target && l < bags[i].size();
             k += i, l++) {
          if (parent[j + k] == -1) {
            parent[j + k] = bags[i][l];
          }
        }
      }
    }
  }
  if (parent[target] == -1) {
    cout << -1 << endl;
    return 0;
  }
  taken[maxbag] = 1;
  while (target != 0) {
    taken[parent[target]] = 1;
    target -= coin[parent[target]];
  }
  int pre = -1;
  for (int i = 0; i <= maxa; i++) {
    for (int j = 0; j < bags[i].size(); j++) {
      if (taken[bags[i][j]]) {
        contained_bags[bags[i][j]] = -1;
      } else {
        contained_bags[bags[i][j]] = pre;
        pre = bags[i][j];
      }
    }
  }
  contained_bags[maxbag] = pre;
  for (int i = 0; i < n; i++) {
    if (contained_bags[i] == -1) {
      cout << coin[i] << " 0\n";
    } else {
      cout << coin[i] - coin[contained_bags[i]] << " 1 "
           << contained_bags[i] + 1 << "\n";
    }
  }
  return 0;
}
