#include <bits/stdc++.h>
using namespace std;
const int MaxN = 50;
int a[MaxN];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  sort(a, a + n);
  int top = 0;
  while (k > 0) {
    for (int i = 0; i < min(k, n - top); ++i) {
      printf("%d", top + 1);
      for (int j = 0; j < top; ++j) printf(" %d", a[n - j - 1]);
      printf(" %d\n", a[i]);
    }
    k -= n - top;
    ++top;
  }
  return 0;
}
