#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
using namespace std;
long long a[55];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  reverse(a + 1, a + 1 + n);
  for (long long j = 1; j <= n; j++) {
    cout << 1 << " " << a[j] << endl;
    k--;
    if (!k) return 0;
    for (long long i = j + 1; i <= n; i++) {
      k--;
      cout << j + 1 << " ";
      for (long long w = 1; w <= j; w++) {
        cout << a[w] << " ";
      }
      cout << a[i] << endl;
      if (!k) return 0;
    }
  }
  return 0;
}
