#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100;
vector<pair<int, int>> mas(0);
map<int, bool> mymap;
int main() {
  int n, m = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int a = 0;
    cin >> a;
    mas.push_back(make_pair(a, i));
  }
  sort(mas.begin(), mas.end());
  reverse(mas.begin(), mas.end());
  int cit = 0;
  for (int i = 0; i < mas.size(); i++) {
    for (int j = i; j < mas.size(); j++) {
      if (cit == m) return 0;
      cout << i + 1 << " ";
      for (int k = 0; k < i; k++) {
        cout << mas[k].first << " ";
      }
      cout << mas[j].first << endl;
      cit++;
    }
  }
  return 0;
}
