#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int main() {
  int n, k;
  while (cin >> n >> k) {
    vector<int> beauties(n);
    for (int i = 0; i < n; i++) cin >> beauties[i];
    sort((beauties).begin(), (beauties).end());
    vector<vector<int> > batallions;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n - i; j++) {
        vector<int> actual;
        actual.push_back(beauties[j]);
        for (int t = n - i; t < n; t++) actual.push_back(beauties[t]);
        batallions.push_back(actual);
      }
    }
    for (int i = 0; i < k; i++) {
      vector<int> dayI = batallions[i];
      cout << dayI.size() << " ";
      for (int j = 0; j < dayI.size(); j++) cout << dayI[j] << " ";
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}
