#include <bits/stdc++.h>
using namespace std;
bool comp(int a, int b) {
  if (a > b) return 1;
  return 0;
}
int main() {
  int ar[300000];
  int peshehodi[300000];
  pair<int, int> taxisti[300000];
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  int n, m, temp, pos1 = 0, pos2 = 0;
  cin >> n >> m;
  for (int i = 0; i < n + m; i++) cin >> ar[i];
  for (int i = 0; i < n + m; i++) {
    cin >> temp;
    if (temp == 0) {
      peshehodi[pos1] = ar[i];
      pos1++;
    } else {
      taxisti[pos2] = {ar[i], 0};
      pos2++;
    }
  }
  taxisti[pos2] = {-2147483648, 0};
  int pos = n - 1;
  sort(peshehodi, peshehodi + n, comp);
  for (int i = 0; i < m; i++) {
    while (pos >= 0 && abs(peshehodi[pos] - taxisti[i].first) <=
                           abs(peshehodi[pos] - taxisti[i + 1].first)) {
      pos--;
      taxisti[i].second++;
    }
  }
  for (int i = 0; i < m; i++) cout << taxisti[i].second << ' ';
  return 0;
}
