#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, arr[51] = {};
  vector<int> front;
  cin >> n >> k;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  sort(arr, arr + n, greater<int>());
  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n && k > 0; ++j, --k) {
      cout << i + 1;
      for (int l = 0; l < front.size(); ++l) {
        cout << ' ' << front[l];
      }
      cout << ' ' << arr[j] << endl;
    }
    front.push_back(arr[i]);
  }
}
