#include <bits/stdc++.h>
using namespace std;
int n, k, l[50 + 1];
void Answer() {
  int j = 1, s = n;
  for (int i = 1; i <= k; i++) {
    if (i > s) s += n - (++j) + 1;
    cout << j << " ";
    for (int u = n - 1; u > n - j; u--) cout << l[u] << " ";
    cout << l[s - i] << endl;
  }
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> l[i];
  sort(l, l + n);
  Answer();
  return 0;
}
