#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, k;
  int a[100];
  int count = 0;
  cin >> n >> k;
  for (int i = (0); i < ((n)); ++i) cin >> a[i];
  sort(a, a + n, greater<int>());
  for (int i = (0); i < ((n)); ++i) {
    for (int j = (i); j < (n); ++j) {
      cout << i + 1;
      for (int m = (0); m < ((i)); ++m) cout << " " << a[m];
      cout << " " << a[j] << endl;
      ++count;
      if (count == k) return 0;
    }
  }
  return 0;
}
