#include <bits/stdc++.h>
using namespace std;
map<long long, vector<long long> > a;
map<long long, vector<long long> >::iterator ii;
map<long long, vector<long long> >::reverse_iterator jj;
vector<long long> w(100, 0);
long long n, k;
void print() {
  long long cnt = 0;
  for (ii = a.begin(); ii != a.end(); ii++) {
    if ((ii->first) > 0) {
      vector<long long> qq = ii->second;
      cout << qq.size() - 1 << " ";
      for (long long i = 1; i < qq.size(); i++) cout << qq[i] << " ";
      cout << endl;
      cnt = cnt + 1;
      if (cnt == k) exit(0);
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  long long i, j;
  for (i = 1; i <= n; i++) cin >> w[i];
  vector<long long> q;
  q.push_back(0);
  a[0] = q;
  long long cur = 1;
  while (a.size() <= k) {
    for (jj = a.rbegin(); jj != a.rend(); jj++) {
      long long www = jj->first;
      vector<long long> qqq = jj->second;
      long long next = www + w[cur];
      vector<long long> qw = a[next];
      if (qw.size() == 0) {
        qqq.push_back(w[cur]);
        a[next] = qqq;
      }
    }
    cur++;
  }
  print();
  return 0;
}
