#include <bits/stdc++.h>
using namespace std;
long long int arr[100005] = {0};
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  vector<long long int> v1, v2;
  for (long long int i = 0; i < (n + m); i++) {
    long long int x;
    cin >> x;
    v1.push_back(x);
  }
  vector<long long int> ans;
  for (long long int i = 0; i < (n + m); i++) {
    long long int x;
    cin >> x;
    v2.push_back(x);
    if (x == 1) ans.push_back(v1[i]);
  }
  long long int counter = 0;
  for (long long int i = 0; i < n + m; i++) {
    if (v2[i] == 0) {
      if (v1[i] < ans[0])
        arr[0]++;
      else if (v1[i] > ans[ans.size() - 1])
        arr[ans.size() - 1]++;
      else {
        while (!(v1[i] > ans[counter] && v1[i] < ans[counter + 1])) counter++;
        long long int d1 = v1[i] - ans[counter];
        long long int d2 = ans[counter + 1] - v1[i];
        if (d1 <= d2)
          arr[counter]++;
        else
          arr[counter + 1]++;
      }
    }
  }
  for (long long int i = 0; i < ans.size(); i++) {
    cout << arr[i] << " ";
  }
  return 0;
}
