#include <bits/stdc++.h>
using namespace std;
int dezN(int c) {
  int d = 1;
  while (c / d) d *= 10;
  return d / 10;
}
int dezC(int c) {
  int cnt = 1, d = 1;
  while (c) {
    d *= 10;
    cnt++;
  }
  return cnt;
}
int main() {
  unsigned long long n, m;
  cin >> n >> m;
  vector<unsigned long long> adres;
  vector<bool> work;
  vector<unsigned long long> taxi;
  for (unsigned long long i = 0; i < n + m; i++) {
    unsigned long long tmp;
    cin >> tmp;
    adres.push_back(tmp);
  }
  for (unsigned long long i = 0; i < n + m; i++) {
    bool tmp;
    cin >> tmp;
    work.push_back(tmp);
    if (tmp) taxi.push_back(adres[i]);
  }
  unsigned long long fn = 0;
  unsigned long long cnt = 0;
  unsigned long long j = 1;
  if (j < taxi.size())
    fn = taxi[j - 1] + (taxi[j] - taxi[j - 1]) / 2;
  else
    fn = 0;
  for (unsigned long long i = 0; i < n + m; i++) {
    if (adres[i] > fn && fn) {
      cout << cnt << ' ';
      cnt = 0;
      j++;
      if (j < taxi.size())
        fn = taxi[j - 1] + (taxi[j] - taxi[j - 1]) / 2;
      else
        fn = 0;
    }
    if (!work[i]) cnt++;
  }
  cout << cnt << ' ' << endl;
  return 0;
}
