#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> n >> m;
  bool t;
  int t0 = 0;
  int t1 = 0;
  int A[m + n];
  for (int i = 0; i < m + n; i++) cin >> A[i];
  if (m == 1) {
    cout << n;
    return 0;
  }
  do {
    t0++;
    cin >> t;
  } while (!t);
  t0--;
  int c = 1;
  int r = t0;
  for (int i = t0 + 1; i < m + n; i++) {
    cin >> t;
    if (t) {
      c++;
      t1 = i;
      int j;
      for (j = t0 + 1; j < t1; j++)
        if (A[j] - A[t0] <= A[t1] - A[j])
          r++;
        else
          break;
      cout << r << " ";
      r = t1 - j;
      t0 = t1;
    }
    if (c == m) {
      r += m + n - t1 - 1;
      cout << r << " ";
      break;
    }
  }
}
