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