#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100500;
const int INF = 1 << 30;
const int MOD = int(1e9) + 7;
int n, k, a[55], cnt;
vector<int> cur;
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = n; i >= 1; i--) {
    for (int j = 1; j <= i; j++) {
      cout << cur.size() + 1 << " ";
      for (int v = 0; v < cur.size(); v++) cout << cur[v] << " ";
      cout << a[j] << "\n";
      k--;
      if (k == 0) return 0;
    }
    cur.push_back(a[i]);
    if (k == 0) return 0;
  }
  for (int j = 1; j <= n; j++) {
    cout << cur.size() + 1 << " ";
    for (int v = 0; v < cur.size(); v++) cout << cur[v] << " ";
    cout << a[j] << "\n";
  }
  return 0;
}
