#include <bits/stdc++.h>
using namespace std;
int n, m, a[55];
map<int, long long> events;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  for (int i = 0; i < n && m > 0; ++i) {
    map<int, long long> temp = events;
    for (map<int, long long>::iterator e = events.begin();
         e != events.end() && m > 0; ++e)
      if (!temp.count(e->first + a[i])) {
        m--;
        vector<int> v;
        for (int j = 0; j < i; ++j)
          if (e->second >> j & 1) v.push_back(a[j]);
        v.push_back(a[i]);
        printf("%d", (int)v.size());
        for (int j = 0; j < (int)v.size(); ++j) printf(" %d", v[j]);
        puts("");
        temp[e->first + a[i]] = e->second | 1LL << i;
      }
    events = temp;
    if (m > 0 && !events.count(a[i])) {
      m--;
      events[a[i]] = 1LL << i;
      printf("1 %d\n", a[i]);
    }
  }
}
