#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int a[n + m + 10], t[n + m + 10];
  int total = n + m;
  for (int i = 0; i < total; i++) cin >> a[i];
  for (int i = 0; i < total; i++) cin >> t[i];
  int pre = 0, now = 0, npre = 0;
  int cnt = 0;
  int pos = 0;
  while (t[pos] != 1) {
    pos++;
    cnt++;
  }
  pre = cnt;
  for (int j = 1; j < m; j++) {
    int l = a[pos], r, mid;
    int lpos = pos + 1, rpos;
    for (int i = pos + 1; i < total; i++) {
      if (t[i] == 1) {
        r = a[i];
        rpos = i - 1;
        pos = i;
        break;
      }
    }
    mid = l + (r - l) / 2;
    for (int i = lpos; i <= rpos; i++) {
      if (a[i] <= mid)
        pre++;
      else
        npre++;
    }
    cout << pre << " ";
    pre = npre;
    npre = 0;
  }
  now = total - pos - 1;
  cout << pre + now << "\n";
  return 0;
}
