#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int K = 200;
const int mod = 998244353;
int power(int a, int b) {
  int res = 1;
  while (b) {
    if (b & 1) {
      res = 1LL * res * a % mod;
    }
    a = 1LL * a * a % mod;
    b >>= 1;
  }
  return res;
}
int n, m, last, x[500005], l[500005], r[500005], t[500005];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n + m; i++) {
    scanf("%d", &x[i]);
  }
  last = 0;
  for (int i = 1; i <= n + m; i++) {
    scanf("%d", &t[i]);
    if (t[i] == 0) {
      l[i] = last;
    } else {
      last = i;
    }
  }
  last = n + m + 1;
  for (int i = n + m; i >= 1; i--) {
    scanf("%d", &t[i]);
    if (t[i] == 0) {
      r[i] = last;
    } else {
      last = i;
    }
  }
  x[0] = -1e9;
  x[n + m + 1] = 2e9;
  vector<int> v[n + m + 10];
  for (int i = 1; i <= n + m; i++) {
    if (t[i] == 0) {
      if (x[i] - x[l[i]] <= x[r[i]] - x[i]) {
        v[l[i]].push_back(i);
      } else {
        v[r[i]].push_back(i);
      }
    }
  }
  for (int i = 1; i <= n + m; i++) {
    if (t[i] == 1) {
      printf("%d ", v[i].size());
    }
  }
  return 0;
}
