#include <bits/stdc++.h>
using namespace std;
int m[200010];
int cnt[200010];
int c[200010];
vector<int> v[200010];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> m[i];
    cnt[m[i]]++;
  }
  sort(m, m + n);
  for (int i = 1; i <= k; i++) {
    cin >> c[i];
  }
  for (int i = 1; i <= k; i++) {
    cnt[i] += cnt[i - 1];
  }
  int ans = 0;
  for (int i = 1; i <= k; i++) {
    ans = max(ans, (n - cnt[i - 1] + c[i] - 1) / c[i]);
  }
  cout << ans << endl;
  int p = 0;
  for (int i = 0; i < n; i++) {
    v[p].push_back(m[i]);
    p++;
    if (p == ans) p = 0;
  }
  for (int i = 0; i < ans; i++) {
    cout << v[i].size() << ' ';
    for (int j = 0; j < v[i].size(); j++) {
      cout << v[i][j] << ' ';
    }
    cout << endl;
  }
}
