#include <bits/stdc++.h>
using namespace std;
set<pair<int, int>> b;
pair<int, int> O[50];
int P[25 * 51];
int n, k;
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    b.insert(make_pair(a, i + 1));
  }
  int c = 0;
  for (auto a : b) {
    O[c] = a;
    c++;
  }
  int d = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n - i; j++) {
      cout << j + 1 << " ";
      cout << O[i].first << " ";
      for (int l = 0; l < j; l++) {
        cout << O[n - l - 1].first << " ";
      }
      cout << "\n";
      d++;
      if (d == k) break;
    }
    if (d == k) break;
  }
  return 0;
}
