#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return (a ? gcd(b % a, a) : b);
}
long long int modPow(long long int x, long long int n, long long int MOD) {
  long long int res = 1;
  while (n > 0) {
    if (n % 2 == 1) {
      res = (res * x) % MOD;
    }
    n /= 2;
    x = (x * x) % MOD;
  }
  return res;
}
long long int modInverse(long long int a, long long int p) {
  return modPow(a, p - 2, p);
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, k, i, j;
  cin >> n >> k;
  int arr[n];
  for (i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  int c = 0, num = 1;
  while (k > 0) {
    for (i = 0; i < min(n, k) - num + 1; i++) {
      cout << num << " ";
      int p = 1;
      while (p < num) {
        cout << arr[n - p] << " ";
        p++;
      }
      cout << arr[i];
      cout << "\n";
    }
    num++;
    k -= n - num + 1;
  }
}
