#include <bits/stdc++.h>
using namespace std;
int x[200005];
int t[200005];
int ans[200005];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n + m; i++) {
    scanf("%d", &x[i]);
  }
  int last = 0;
  for (int i = 1; i <= n + m; i++) {
    scanf("%d", &t[i]);
    if (t[i] == 1) {
      if (i - last == 1)
        last = i;
      else {
        for (int j = last + 1; j < i; j++) {
          if (last == 0 || x[i] - x[j] < x[j] - x[last])
            ans[i]++;
          else
            ans[last]++;
        }
        last = i;
      }
    }
  }
  for (int i = last + 1; i <= n + m; i++) {
    ans[last]++;
  }
  for (int flag = 0, i = 1; i <= n + m; i++) {
    if (t[i] == 1) {
      if (flag == 0) {
        printf("%d", ans[i]);
        flag++;
      } else
        printf(" %d", ans[i]);
    }
  }
  return 0;
}
