#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1, -1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return a.first > b.first;
}
template <typename T>
inline T Bigmod(T base, T power, T MOD) {
  T ret = 1;
  while (power) {
    if (power & 1) ret = (ret * base) % MOD;
    base = (base * base) % MOD;
    power >>= 1;
  }
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  int n, m;
  while (cin >> n >> m) {
    vector<int> cord(m + n), residents(m + n);
    for (int i = 0; i < m + n; i++) cin >> cord[i];
    for (int i = 0; i < m + n; i++) cin >> residents[i];
    vector<int> ans(m + n);
    int fst, scnd;
    for (int i = 0; i < m + n; i++) {
      if (residents[i] == 1) {
        fst = i;
        scnd = i;
        break;
      }
    }
    for (int i = 0; i < m + n; i++) {
      if (i > scnd) {
        fst = scnd;
        scnd = n + m;
        for (int j = i; j < m + n; j++) {
          if (residents[j] == 1) {
            scnd = j;
            break;
          }
        }
      }
      if (residents[i] == 1) continue;
      if (scnd == n + m ||
          abs(cord[i] - cord[fst]) <= abs(cord[i] - cord[scnd]))
        ans[fst]++;
      else
        ans[scnd]++;
    }
    for (int i = 0; i < m + n; i++)
      residents[i] == 1 ? cout << ans[i] << " " : cout << "";
    cout << endl;
  }
  return 0;
}
