#include <bits/stdc++.h>
using namespace std;
int n, k, a[55];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) scanf("%d", a + i);
  sort(a, a + n);
  reverse(a, a + n);
  set<int> st;
  for (int i = 0; i < n && k; ++i) printf("1 %d\n", a[i]), --k;
  vector<int> v;
  for (int len = 1; len <= n && k; ++len) {
    v.push_back(a[v.size()]);
    for (int i = v.size(); i < n && k; ++i) {
      printf("%d ", v.size() + 1);
      for (int j = 0; j < v.size(); ++j) printf("%d ", v[j]);
      printf("%d\n", a[i]);
      --k;
    }
  }
  return 0;
}
