#include <bits/stdc++.h>
using namespace std;
struct cmp {
  bool operator()(const int &u, const int &v) { return u > v; }
};
vector<int> vi;
set<int, cmp> se, ck;
int a[55];
int n, k;
int main() {
  if (0) {
    freopen("a.inp", "r", stdin);
    freopen("a.out", "w", stdout);
  };
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n && k; i++) {
    printf("1 %d\n", a[i]);
    k--;
    se.insert(a[i]);
  }
  for (int i = 2; i <= n && k; i++) {
    vi.push_back(*se.begin());
    ck.insert(*se.begin());
    se.erase(se.begin());
    for (int j = 1; j <= n && k; j++)
      if (ck.find(a[j]) == ck.end()) {
        printf("%d", i);
        for (int jj = 0; jj < (int)vi.size(); jj++) printf(" %d", vi[jj]);
        printf(" %d\n", a[j]);
        k--;
      }
  }
}
