#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int ar[n + m];
  for (int i = 0; i < n + m; i++) {
    scanf("%d", &ar[i]);
  }
  int t[n + m];
  for (int i = 0; i < n + m; i++) scanf("%d", &t[i]);
  int rider[n];
  int driver[m];
  int idx1 = 0, idx2 = 0;
  for (int i = 0; i < n + m; i++) {
    if (t[i] == 0) {
      rider[idx1++] = ar[i];
    } else {
      driver[idx2++] = ar[i];
    }
  }
  int a[m];
  memset(a, 0, sizeof(a));
  for (int i = 0; i < n; i++) {
    int x = rider[i];
    int lo = 0;
    int hi = m - 1;
    while (lo <= hi) {
      int mid = (lo + hi) >> 1;
      if (x >= driver[mid])
        lo = mid + 1;
      else
        hi = mid - 1;
    }
    int maxi = 1000000500;
    int ans = 0;
    if (lo + 1 < m && lo + 1 >= 0) {
      if (abs(x - driver[lo + 1]) <= maxi) {
        maxi = abs(x - driver[lo + 1]);
        ans = lo + 1;
      }
    }
    if (lo < m && lo >= 0) {
      if (abs(x - driver[lo]) <= maxi) {
        maxi = abs(x - driver[lo]);
        ans = lo;
      }
    }
    if (lo - 1 < m && lo - 1 >= 0) {
      if (abs(x - driver[lo - 1]) <= maxi) {
        maxi = abs(x - driver[lo - 1]);
        ans = lo - 1;
      }
    }
    a[ans]++;
  }
  for (int i = 0; i < m; i++) printf("%d ", a[i]);
}
