#include <bits/stdc++.h>
using namespace std;
int a[50], r[50];
int main() {
  int n, m, i, j, k, t;
  scanf("%d%d", &n, &m);
  for (i = 0; i < n; i++) scanf("%d", a + i);
  sort(a, a + n, greater<int>());
  for (i = -1; i < n; i++) {
    if (m == 0) break;
    for (j = i + 1; j < n; j++) {
      if (m == 0) break;
      t = 0;
      for (k = 0; k <= i; k++) r[t++] = a[k];
      r[t++] = a[j];
      printf("%d %d", t, r[0]);
      for (k = 1; k < t; k++) printf(" %d", r[k]);
      putchar('\n');
      m--;
    }
  }
}
