#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt;
  cin >> n >> cnt;
  int numbers[n + 1];
  for (int i = 0; i < n; i++) cin >> numbers[i];
  sort(numbers, numbers + n, greater<int>());
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      cout << i + 1 << " ";
      for (int k = 0; k < i; k++) {
        cout << numbers[k] << " ";
      }
      cout << numbers[j] << endl;
      cnt--;
      if (cnt == 0) return 0;
    }
  }
}
