#include <bits/stdc++.h>
using namespace std;
int main(int argc, char** argv) {
  int n, k;
  cin >> n >> k;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  int cnt = 0;
  for (int i = 0; i <= n; i++) {
    for (int l = 1; l <= n - i; l++) {
      cout << i + 1 << " ";
      for (int j = n; j >= n - i + 1; j--) cout << a[j] << " ";
      cout << a[l] << endl;
      cnt++;
      if (cnt == k) return 0;
    }
  }
  return 0;
}
