#include <bits/stdc++.h>
using namespace std;
template <class T>
T min(T a, T b, T c) {
  return min(a, min(b, c));
}
template <class T>
T min(T a, T b, T c, T d) {
  return min(a, min(b, min(c, d)));
}
template <class T>
T max(T a, T b, T c) {
  return max(a, max(b, c));
}
template <class T>
T max(T a, T b, T c, T d) {
  return max(a, max(b, max(c, d)));
}
bool cmp(int a, int b) { return a > b; }
long long GCD(long long a, long long b) { return (a % b) ? GCD(b, a % b) : b; }
const string namePro = "tmp";
int a[100007];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = (1); i <= (n); ++i) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1, cmp);
  for (int i = (1); i <= (n); ++i) {
    --k;
    printf("1 %d\n", a[i]);
    if (!k) return 0;
  }
  for (int i = (1); i <= (n); ++i) {
    for (int j = (i + 1); j <= (n); ++j) {
      printf("%d ", i + 1);
      for (int k = (1); k <= (i); ++k) printf("%d ", a[k]);
      printf("%d\n", a[j]);
      --k;
      if (!k) return 0;
    }
  }
  return 0;
}
