#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
const double PI = acos(-1.0);
const int EPS = (1e-10);
const int N = 1e5 * 2 + 10;
const int inf = 1e9 * 2 + 10;
const ll INF = 1e18 * 2 + 10;
const int MOD = 1e9 + 7;
int nxt() {
  int x;
  cin >> x;
  return x;
}
int fcmp(double a, double b) {
  return (fabs(a - b) < EPS ? 0 : a > b ? 1 : -1);
}
int n, k, a[N];
map<int, bool> mp;
vector<pair<int, int> > calc(int st, int Sz) {
  vector<pair<int, int> > res;
  for (int mask = (0); mask <= ((1 << Sz) - 1); ++mask) {
    int s = 0;
    for (int i = (0); i <= (Sz - 1); ++i)
      if (mask & (1 << i)) {
        s += a[i + st];
      }
    res.push_back({s, mask});
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> k;
  for (int i = (0); i <= (n - 1); ++i) cin >> a[i];
  sort(a, a + n);
  int s = 0, j = 0;
  for (int i = (0); i <= (k - 1); ++i) {
    cout << s + 1 << " ";
    for (int p = (0); p <= (s - 1); ++p) cout << a[n - 1 - p] << " ";
    cout << a[j++] << "\n";
    if (n - j == s) {
      s++;
      j = 0;
    }
  }
  return 0;
}
