#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, pr;
  int tmp = -1;
  cin >> n >> m;
  vector<int> ally(n + m);
  vector<int> kol(n + m);
  vector<int> check;
  vector<int> ans(m);
  for (int i = 0; i < (n + m); i++) {
    cin >> pr;
    ally[i] = pr;
  }
  for (int i = 0; i < (n + m); i++) {
    cin >> pr;
    kol[i] = pr;
    if (pr == 1) check.push_back(i);
  }
  for (int i = 0, j = 0; i < (n + m); i++) {
    if (kol[i] == 1) {
      if (j == m - 1) goto fin;
      tmp = (ally[check[j + 1]] + ally[check[j]]) >> 1;
      j++;
      continue;
    }
    if (tmp != -1) {
      if (ally[i] <= tmp)
        ans[j - 1]++;
      else
        ans[j]++;
    }
  }
fin:
  ans[0] += check[0];
  ans[m - 1] += n + m - check[m - 1] - 1;
  for (int i = 0; i < m; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
