#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, i, j, sum, m, n, jum, dep, bel, dat[100010], tulis[10000];
bool cmp(int x, int y) { return (x > y); }
int main() {
  scanf("%d%d", &n, &m);
  for (a = 0; a < n; a++) {
    scanf("%d", &dat[a]);
  }
  sort(dat, dat + n, cmp);
  dep = 0;
  bel = 0;
  for (a = 0; a < m; a++) {
    if (bel == n) {
      dep++;
      bel = dep;
    }
    jum = 0;
    for (b = 0; b < dep; b++) {
      tulis[jum] = dat[b];
      jum++;
    }
    tulis[jum] = dat[bel];
    jum++;
    bel++;
    printf("%d", jum);
    for (b = 0; b < jum; b++) {
      printf(" %d", tulis[b]);
      tulis[b] = 0;
    }
    printf("\n");
  }
  return 0;
}
