#include <bits/stdc++.h>
using namespace std;
unordered_set<int> S;
int done = 0;
int req;
;
void print(vector<int> &arr) {
  for (int i = 0; i <= arr.size(); ++i) {
    for (int k = (int)arr.size() - i - 1; k >= 0; --k) {
      cout << i + 1 << " ";
      int p = 0, j = (int)arr.size() - 1;
      while (p++ != i) cout << arr[j--] << " ";
      cout << arr[k] << endl;
      done++;
      if (done == req) return;
    }
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  int n;
  vector<int> a;
  cin >> n >> req;
  for (int i = 0; i < n; ++i) {
    int b;
    cin >> b;
    a.push_back(b);
  }
  sort(a.begin(), a.end());
  print(a);
  return 0;
}
