#include <bits/stdc++.h>
using namespace std;
const int I = 1000 * 1000 * 1000 * 2 + 10;
const int N = 1e5 + 50;
int Wczytaj[N * 2];
int Taxi[N];
int Rezydent[N];
int Wynik[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, a;
  int l1, l2;
  l1 = l2 = 0;
  cin >> n >> m;
  for (int i = 1; i <= n + m; i++) cin >> Wczytaj[i];
  for (int i = 1; i <= n + m; i++) {
    cin >> a;
    if (a == 0)
      Rezydent[++l1] = Wczytaj[i];
    else
      Taxi[++l2] = Wczytaj[i];
  }
  Taxi[m + 1] = I;
  int i = 1;
  for (int j = 1; j <= m; j++) {
    while (i <= n &&
           abs(Rezydent[i] - Taxi[j]) <= abs(Rezydent[i] - Taxi[j + 1])) {
      i++;
      Wynik[j]++;
    }
  }
  for (int i = 1; i <= m; i++) cout << Wynik[i] << " ";
  cout << "\n";
  return 0;
}
