#include <bits/stdc++.h>
using namespace std;
const int PMTH = 3 * int(1e5) + 5;
int n, cnt, x[PMTH], b[PMTH], Ans[PMTH];
int Tenter() {
  int tmp = 0, m;
  cin >> n >> m;
  for (int i = (1); i <= (n + m); i++) cin >> x[i];
  for (int i = (1); i <= (n + m); i++) {
    cin >> tmp;
    if (tmp) b[++cnt] = i;
  }
  return 0;
}
int Tsolve() {
  int MID = INT_MAX;
  Ans[1] = b[1] - 1;
  Ans[cnt] += n + cnt - b[cnt];
  for (int i = (1); i <= (cnt - 1); i++) {
    MID = (x[b[i]] + x[b[i + 1]]) / 2;
    for (int j = (b[i] + 1); j <= (b[i + 1] - 1); j++)
      if (x[j] <= MID)
        Ans[i]++;
      else
        Ans[i + 1]++;
  }
  for (int i = (1); i <= (cnt); i++) cout << Ans[i] << " ";
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  Tenter();
  Tsolve();
  return 0;
}
