#include <bits/stdc++.h>
const double EPS = 1e-9;
const double PI = acos(-1.0);
using namespace std;
int n, k, K = 0;
int a[60];
int main() {
  cin >> n >> k;
  for (int i = 0; i < (int)n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  for (int len = 1; len <= n && K < k; len++) {
    for (int j = n - len; j >= 0 && K < k; j--) {
      printf("%d ", len);
      for (int i = n - 1; i > n - len; i--) printf("%d ", a[i]);
      printf("%d\n", a[j]);
      K++;
    }
  }
  return 0;
}
