#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 2;
int a[maxn << 1];
long long vis[maxn];
int main(void) {
  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n, m;
  while (cin >> n >> m) {
    int k = 0;
    int t;
    vector<int> a(n + m + 1);
    vector<long long> vis(m);
    for (int i = 1; i <= n + m; i++) cin >> a[i];
    for (int i = 1; i <= n + m; i++) cin >> t, t ? vis[k++] = a[i] : 1;
    vis[k] = (int)1e18;
    for (int i = 1, j = 0; i <= n + m; j++) {
      int cnt = 0;
      while (a[i] < vis[j]) cnt++, i++;
      i++;
      while (a[i] - vis[j] <= vis[j + 1] - a[i] && i <= n + m) cnt++, i++;
      cout << cnt << " ";
    }
    cout << endl;
  }
}
