#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, j, n, k;
  cin >> n >> k;
  vector<long long int> v(n);
  for (i = 0; i < n; i++) cin >> v[i];
  for (i = 0; i < min(k, n); i++) cout << 1 << " " << v[i] << endl;
  if (k > n) {
    sort(v.begin(), v.end());
    k -= n;
    for (i = n - 2; i >= 0; i--) {
      vector<long long int> a;
      for (j = n - 1; j > i; j--) a.push_back(v[j]);
      for (j = i; j >= 0; j--) {
        a.push_back(v[j]);
        cout << a.size() << " ";
        for (long long int it = 0; it < a.size(); it++) cout << a[it] << " ";
        cout << endl;
        a.pop_back();
        k--;
        if (!k) return 0;
      }
    }
  }
}
