#include <bits/stdc++.h>
using namespace std;
long long a[5000005], b[5000005], r, m = 0, n, co;
map<long long, long long> mp;
int main() {
  ios_base::sync_with_stdio(false);
  long long t = 0, x, sum = 0, q = 0, z = 0, y = 0, l = 0, i, j, k;
  cin >> n >> k;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  l = 0;
  b[0] = n + 1;
  j = n;
  while (k) {
    for (i = j; i >= 1; i--) {
      cout << l + 1 << " ";
      for (x = 1; x <= l; x++) cout << a[b[x]] << " ";
      cout << a[i] << endl;
      k--;
      if (k == 0) break;
    }
    b[++l] = b[l - 1] - 1;
    j--;
  }
  return 0;
}
