#include <bits/stdc++.h>
using namespace std;
int n, k, tot, a[51];
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      cout << i << " ";
      for (int k = 1; k <= i - 1; k++) cout << a[n - k + 1] << " ";
      cout << a[n - j + 1] << endl;
      if (++tot == k) return 0;
    }
  }
}
