Problem: There are m people living in a city. There are n dishes sold in the city. Each dish i has a price p_i, a standard s_i and a beauty b_i. Each person j has an income of inc_j and a preferred beauty pref_j. 

A person would never buy a dish whose standard is less than the person's income. Also, a person can't afford a dish with a price greater than the income of the person. In other words, a person j can buy a dish i only if p_i ≤ inc_j ≤ s_i.

Also, a person j can buy a dish i, only if |b_i-pref_j| ≤ (inc_j-p_i). In other words, if the price of the dish is less than the person's income by k, the person will only allow the absolute difference of at most k between the beauty of the dish and his/her preferred beauty. 

Print the number of dishes that can be bought by each person in the city.

Input

The first line contains two integers n and m (1 ≤ n ≤ 10^5, 1 ≤ m ≤ 10^5), the number of dishes available in the city and the number of people living in the city.

The second line contains n integers p_i (1 ≤ p_i ≤ 10^9), the price of each dish.

The third line contains n integers s_i (1 ≤ s_i ≤ 10^9), the standard of each dish.

The fourth line contains n integers b_i (1 ≤ b_i ≤ 10^9), the beauty of each dish.

The fifth line contains m integers inc_j (1 ≤ inc_j ≤ 10^9), the income of every person.

The sixth line contains m integers pref_j (1 ≤ pref_j ≤ 10^9), the preferred beauty of every person.

It is guaranteed that for all integers i from 1 to n, the following condition holds: p_i ≤ s_i.

Output

Print m integers, the number of dishes that can be bought by every person living in the city.

Examples

Input


3 3
2 1 3
2 4 4
2 1 1
2 2 3
1 2 4


Output


1 2 0 

Input


4 3
1 2 1 1
3 3 1 3
2 1 3 2
1 1 3
1 2 1


Output


0 2 3 

Note

In the first example, the first person can buy dish 2, the second person can buy dishes 1 and 2 and the third person can buy no dishes.

In the second example, the first person can buy no dishes, the second person can buy dishes 1 and 4, and the third person can buy dishes 1, 2 and 4.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
int n, m, d, i, j, k, p[100005], s[100005], b[100005];
int ans[100005];
struct read {
  int in, pr, pos;
} rd[100005];
bool cmp(read &a, read &b) { return a.in < b.in; }
bool cmp2(read &a, read &b) { return a.in - a.pr < b.in - b.pr; }
pair<int, int> getid(int l, int r, read *num) {
  int L, R, mid;
  pair<int, int> ret;
  L = 1, R = m;
  while (L < R) {
    mid = (L + R) / 2;
    if (num[mid].in >= l)
      R = mid;
    else
      L = mid + 1;
  }
  ret.first = L;
  L = 1, R = m;
  while (L < R) {
    mid = (L + R) / 2;
    if (num[mid + 1].in <= r)
      L = mid + 1;
    else
      R = mid;
  }
  ret.second = L;
  return ret;
}
int unit, l[100005], r[100005], posP[100005];
vector<pair<int, int> > dishPcf[320], dishMcf[320];
int ft[100005];
int bl(int x) { return (x - 1) / unit + 1; }
void ch(int x, int n, int t, int *fw) {
  for (int i = x; i <= n; i += i & (-i)) fw[i] += t;
}
int Q(int x, int *fw) {
  int ret = 0;
  for (; x; x -= x & (-x)) ret += fw[x];
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (i = 1; i <= n; i++) cin >> p[i];
  for (i = 1; i <= n; i++) cin >> s[i];
  for (i = 1; i <= n; i++) cin >> b[i];
  for (i = 1; i <= m; i++) cin >> rd[i].in, rd[i].pos = i;
  for (i = 1; i <= m; i++) cin >> rd[i].pr;
  sort(rd + 1, rd + m + 1, cmp);
  unit = sqrt(m);
  for (i = 1; i <= n; i++) {
    if (s[i] < rd[1].in || p[i] > rd[m].in) continue;
    pair<int, int> tmp = getid(p[i], s[i], rd);
    int lh = tmp.first, rh = tmp.second, lid = bl(lh), rid = bl(rh);
    if (lh > rh) continue;
    if (lid == rid) {
      for (j = lh; j <= rh; j++)
        if (abs(b[i] - rd[j].pr) <= rd[j].in - p[i]) ans[rd[j].pos]++;
    } else {
      for (j = lh; j <= unit * lid; j++)
        if (abs(b[i] - rd[j].pr) <= rd[j].in - p[i]) ans[rd[j].pos]++;
      for (j = unit * (rid - 1) + 1; j <= rh; j++)
        if (abs(b[i] - rd[j].pr) <= rd[j].in - p[i]) ans[rd[j].pos]++;
      dishPcf[lid + 1].push_back(make_pair(p[i] + b[i], i)),
          dishPcf[rid].push_back(make_pair(p[i] + b[i], i));
      dishMcf[lid + 1].push_back(make_pair(p[i] - b[i], i)),
          dishMcf[rid].push_back(make_pair(p[i] - b[i], i));
    }
  }
  map<pair<int, int>, int> HP, HM;
  map<pair<int, int>, int>::iterator it;
  pair<int, int> dP[100005], dM[100005];
  for (i = 1; i <= n; i++)
    HP.insert(make_pair(make_pair(p[i] + b[i], i), 0)),
        HM.insert(make_pair(make_pair(p[i] - b[i], i), 0));
  for (i = 1, it = HP.begin(); i <= n; i++, it++)
    dP[i] = it->first, it->second = i;
  for (i = 1, it = HM.begin(); i <= n; i++, it++)
    dM[i] = it->first, it->second = i;
  bool flP[100005] = {0}, flM[100005] = {0};
  for (i = 1; i <= bl(m); i++) {
    for (pair<int, int> j : dishPcf[i]) {
      int id = HP[j];
      flP[id] = !flP[id];
    }
    for (pair<int, int> j : dishMcf[i]) {
      int id = HM[j];
      flM[id] = !flM[id];
    }
    vector<pair<int, int> > dishP, dishM;
    for (j = 1; j <= n; j++) {
      if (flP[j]) dishP.push_back(dP[j]);
      if (flM[j]) dishM.push_back(dM[j]);
    }
    for (j = 0; j < dishP.size(); j++) posP[dishP[j].second] = j;
    if (dishP.empty()) continue;
    int lh = unit * (i - 1) + 1, rh = min(unit * i, m);
    sort(rd + lh, rd + rh + 1, cmp2);
    int p = 0, q;
    memset(ft, 0, sizeof(ft));
    for (j = lh; j <= rh; j++) {
      while (p < dishM.size() && dishM[p].first <= rd[j].in - rd[j].pr)
        ch(posP[dishM[p].second] + 1, dishP.size(), 1, ft), p++;
      if (dishP[0].first > rd[j].in + rd[j].pr) continue;
      int L = 0, R = dishP.size() - 1, mid;
      while (L < R) {
        mid = (L + R) / 2;
        if (dishP[mid + 1].first <= rd[j].in + rd[j].pr)
          L = mid + 1;
        else
          R = mid;
      }
      ans[rd[j].pos] += Q(L + 1, ft);
    }
  }
  for (i = 1; i <= m; i++) cout << ans[i] << ' ';
  return 0;
}