#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n, tempd = -1, tempc = -1000000001;
  cin >> m >> n;
  vector<int> v(m + n);
  vector<int> d(m + n);
  vector<pair<int, int> > lc(n + m);
  vector<pair<int, int> > rc(n + m);
  for (int i = 0; i < m + n; i++) cin >> v[i];
  for (int i = 0; i < m + n; i++) cin >> d[i];
  for (int i = 0; i < n + m; i++) {
    if (d[i] == 0) {
      lc[i] = make_pair(v[i] - tempc, tempd);
    } else {
      lc[i] = make_pair(0, 0);
      tempd = i;
      tempc = v[i];
    }
  }
  if (n == 1) {
    cout << m;
    return 0;
  }
  tempd = -1, tempc = 1000000001;
  for (int i = n + m - 1; i > -1; i--) {
    if (d[i] == 0) {
      rc[i] = make_pair(tempc - v[i], tempd);
    } else {
      rc[i] = make_pair(0, 0);
      tempd = i;
      tempc = v[i];
    }
  }
  for (int i = 0; i < n + m; i++) {
    if (d[i] == 0) {
      if (rc[i].first > lc[i].first) {
        if (lc[i].second != -1)
          d[lc[i].second]++;
        else if (rc[i].second != -1)
          d[rc[i].second]++;
      } else if (lc[i].first > rc[i].first) {
        if (rc[i].second != -1)
          d[rc[i].second]++;
        else if (lc[i].second != -1)
          d[lc[i].second]++;
      } else {
        if (lc[i].second != -1)
          d[lc[i].second]++;
        else if (rc[i].second != -1)
          d[rc[i].second]++;
      }
    }
  }
  for (int i = 0; i < n + m; i++) {
    if (d[i] != 0) cout << d[i] - 1 << " ";
  }
  return 0;
}
