#include <bits/stdc++.h>
const int N = 52;
int be[N];
std::set<int> hash;
int main() {
  int n, k;
  srand(112414);
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) scanf("%d", be + i);
  while (true) {
    for (int i = 0; i < n; ++i) std::swap(be[i], be[rand() % n]);
    for (int len = 1; len <= n; ++len) {
      for (int i = 0; i + len <= n; ++i) {
        int sum = 0;
        for (int j = 0; j < len; ++j) sum += be[i + j];
        if (hash.count(sum) == 0) {
          printf("%d", len);
          for (int j = 0; j < len; ++j) printf(" %d", be[i + j]);
          printf("\n");
          hash.insert(sum);
          if (hash.size() == k) return 0;
        }
      }
    }
  }
  return 0;
}
