#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long INF = 1e18;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 2;
const int mov[4][2] = {-1, 0, 1, 0, 0, 1, 0, -1};
const int Mov[8][2] = {-1, -1, -1, 0, -1, 1, 0, -1, 0, 1, 1, -1, 1, 0, 1, 1};
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
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;
    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)1e13;
    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;
  }
}
