#include <bits/stdc++.h>
using namespace std;
const long long N = 3 * 1e5 + 1;
long long n, m;
long long q[N];
vector<int> a, b;
int main() {
  ios_base ::sync_with_stdio(NULL);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  vector<int> ans(m);
  for (int i = 0; i < n + m; i++) {
    cin >> q[i];
  }
  for (int i = 0; i < n + m; i++) {
    bool x;
    cin >> x;
    if (x)
      b.push_back(q[i]);
    else
      a.push_back(q[i]);
  }
  int pos = 0;
  for (int i = 0; i < a.size(); i++) {
    int mn = INFINITY;
    for (int j = pos; j < b.size(); j++) {
      if (abs(a[i] - b[j]) >= mn) break;
      mn = min(mn, abs(a[i] - b[j]));
      pos = j;
    }
    ans[pos]++;
  }
  for (auto it : ans) cout << it << ' ';
}
