#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(0);
  long long n, k;
  cin >> n >> k;
  long long A[n], i;
  for (i = 0; i < n; i++) cin >> A[i];
  sort(A, A + n);
  vector<int> ans;
  long long cnt = -1, num;
  while (k) {
    for (i = 0; i < n; i++) {
      if (i == cnt) break;
      cout << ans.size() + 1 << " ";
      for (int j = 0; j < ans.size(); j++) cout << ans[j] << " ";
      cout << A[i] << "\n";
      k--;
      if (k == 0) break;
    }
    cnt = i - 1;
    ans.push_back(A[cnt]);
  }
  return 0;
}
