#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> x(n + m);
  for (int i = 0; i < n + m; i += 1) {
    cin >> x[i];
  }
  vector<int> taxi;
  for (int i = 0, t = 0; i < n + m; i += 1) {
    cin >> t;
    if (t == 1) taxi.push_back(i);
  }
  vector<int> ans(m, 0);
  for (int i = 0, j = 0; i < n + m; i += 1) {
    if (j == m) {
      ans[j - 1] += 1;
    } else if (i < taxi[j]) {
      if (j == 0 || x[taxi[j]] - x[i] < x[i] - x[taxi[j - 1]])
        ans[j] += 1;
      else
        ans[j - 1] += 1;
    } else if (i == taxi[j]) {
      j += 1;
    }
  }
  for (int x : ans) cout << x << " ";
  cout << endl;
}
