#include <bits/stdc++.h>
using namespace std;
bool cmp(pair<long long int, char> p1, pair<long long int, char> p2) {
  return p1.first > p2.first;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k, i;
  cin >> n >> k;
  vector<long long int> v(n);
  for (i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  long long int x = n, y = 0;
  while (k--) {
    cout << n - x + 1 << " ";
    for (i = x; i < n; i++) cout << v[i] << " ";
    cout << v[y] << "\n";
    y++;
    if (y == x) {
      y = 0;
      x--;
    }
  }
}
