#include <bits/stdc++.h>
using namespace std;
int a[60];
int n, k;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) cin >> a[i];
  int j = 0, s = 0;
  sort(a, a + n);
  for (int i = 0; i < k; i++) {
    cout << s + 1 << " ";
    for (int w = 0; w < s; w++) cout << a[n - 1 - w] << " ";
    cout << a[j++] << endl;
    if (j == n - s) {
      j = 0;
      s++;
    }
  }
  return 0;
}
