#include <bits/stdc++.h>
using namespace std;
const int OO = 2e9;
const int MOD = 1e9 + 7;
const double Pi = 3.141592653589793;
const int N = 1e5 + 5;
int a[N], s[N], n, k;
int main() {
  cin >> n >> k;
  for (int i = (int)1; i <= (int)n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = (int)1; i <= (int)n; i++)
    if (k) {
      cout << "1 " << a[i] << endl;
      k--;
    }
  for (int i = (int)n; i >= (int)1; i--)
    if (k)
      for (int j = (int)i - 1; j >= (int)1; j--)
        if (k) {
          cout << n - i + 2 << " ";
          for (int _ = (int)i; _ <= (int)n; _++) cout << a[_] << " ";
          cout << a[j] << endl;
          k--;
        }
}
