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