#include <bits/stdc++.h>
using namespace std;
const int N = 55;
int n, k, a[N];
void solve() {
  for (int i = (0), I = (n + 1); i < I; ++i)
    for (int j = (1), I = (n - i + 1); j < I; ++j) {
      if (k <= 0) return;
      --k;
      printf("%d", i + 1);
      for (int p = (n - i + 1), I = (n + 1); p < I; ++p) printf(" %d", a[p]);
      printf(" %d\n", a[j]);
    }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = (1), I = (n + 1); i < I; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  solve();
  return 0;
}
