#include <bits/stdc++.h>
const long long INF = 10000000000000;
const long long mod = 1e9 + 7;
using namespace std;
void add(int& a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
long long mul(long long a, long long b) { return (a * b) % mod; }
long long Pow(long long a, long long b) {
  if (b == 0) return 1;
  long long c = Pow(a, b / 2);
  if (b % 2) return c * c * a;
  return c * c;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cout.precision(30);
  int n, k;
  cin >> n >> k;
  std::vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  map<long long, bool> maap;
  int nb = 0;
  for (int i = n; i >= 0; i--) {
    for (int j = 0; j < i && nb < k; j++, nb++) {
      cout << n - i + 1 << " ";
      for (int m = n - 1; m >= i; m--) cout << a[m] << " ";
      cout << a[j] << "\n";
    }
  }
  return 0;
}
