#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, counter = 0;
  bool fir = true;
  cin >> n >> m;
  vector<pair<int, bool>> x(n + m);
  vector<pair<int, int>> tax(m);
  for (int i = 0; i < n + m; i++) cin >> x[i].first;
  for (int i = 0; i < n + m; i++) {
    cin >> x[i].second;
    if (x[i].second) {
      tax[counter].first = i;
      tax[counter++].second = 0;
    }
  }
  counter = 0;
  for (int i = 0; i < n + m; i++) {
    if (x[i].second) {
      if (counter != m - 1 && !fir) counter++;
      fir = false;
    } else {
      if (counter != m - 1) {
        if (x[i].first - x[tax[counter].first].first <=
            x[tax[counter + 1].first].first - x[i].first)
          tax[counter].second++;
        else
          tax[counter + 1].second++;
      } else
        tax[counter].second++;
    }
  }
  for (int i = 0; i < m; i++) cout << tax[i].second << ' ';
  return 0;
}
