#include <bits/stdc++.h>
using namespace std;
const long long inf = LONG_MAX;
const long long arr = 1000000;
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  if (a.first == b.first)
    return a.second < b.second;
  else
    return a.first < b.first;
}
int main(void) {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(n + m);
  vector<long long> b(n + m);
  vector<long long> v;
  for (int i = 0; i < n + m; i++) cin >> a[i];
  for (int i = 0; i < n + m; i++) {
    cin >> b[i];
    if (b[i] == 1) v.push_back(a[i] - 1);
  }
  v.push_back(LLONG_MAX);
  long long id = 0;
  map<long long, long long> hmp;
  for (int i = 0; i < n + m; i++) {
    long long t = a[i] - 1;
    if (b[i] == 0) {
      while (t >= v[id + 1]) id++;
      if (t - v[id] <= v[id + 1] - t) {
        hmp[v[id]]++;
      } else
        hmp[v[id + 1]]++;
    }
  }
  for (int i = 0; i < n + m; i++)
    if (b[i] == 1) cout << hmp[a[i] - 1] << " ";
  return 0;
}
