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>
using namespace std;
int income[100005], price[100005], pref[100005], bea[100005], stan[100005];
int tree2[100005];
vector<pair<int, int> > tree[100005 * 5], ques[100005 * 5];
void update(int node, int st, int en, int l, int r, pair<int, int> ps) {
  if (st > r or en < l) return;
  if (st >= l and en <= r) {
    tree[node].push_back(ps);
    return;
  }
  int mid = (st + en) >> 1;
  update(node * 2, st, mid, l, r, ps);
  update(node * 2 + 1, mid + 1, en, l, r, ps);
}
void update2(int node, int st, int en, int pos, pair<int, int> ps) {
  if (st > pos or en < pos) return;
  ques[node].push_back(ps);
  if (st == en) return;
  int mid = (st + en) >> 1;
  update2(node * 2, st, mid, pos, ps);
  update2(node * 2 + 1, mid + 1, en, pos, ps);
}
int query(int idx) {
  int sum = 0;
  while (idx > 0) {
    sum += tree2[idx];
    idx -= idx & (-idx);
  }
  return sum;
}
void update(int idx, int x, int n) {
  while (idx <= n) {
    tree2[idx] += x;
    idx += idx & (-idx);
  }
}
int ans[100005];
void process() {
  for (int node = 1; node <= 400000; node++) {
    sort(tree[node].begin(), tree[node].end());
    vector<int> vc;
    for (int j = 0; j < tree[node].size(); j++) {
      vc.push_back(tree[node][j].second - tree[node][j].first);
    }
    sort(vc.begin(), vc.end());
    sort(ques[node].begin(), ques[node].end());
    int l = 0, r = 0;
    for (int j = 0; j < ques[node].size(); j++) {
      while (l < tree[node].size() &&
             tree[node][l].first <= ques[node][j].first) {
        int f = tree[node][l].second - tree[node][l].first;
        int pos = upper_bound(vc.begin(), vc.end(), f - 1) - vc.begin();
        update(pos + 1, 1, vc.size());
        l++;
      }
      int g = income[ques[node][j].second] - ques[node][j].first;
      int pos = upper_bound(vc.begin(), vc.end(), g) - vc.begin();
      ans[ques[node][j].second] += query(pos);
    }
    l--;
    while (l >= 0) {
      int f = tree[node][l].second - tree[node][l].first;
      int pos = upper_bound(vc.begin(), vc.end(), f - 1) - vc.begin();
      update(pos + 1, -1, vc.size());
      l--;
    }
    vc.clear();
    for (int j = 0; j < tree[node].size(); j++) {
      vc.push_back(tree[node][j].second + tree[node][j].first);
    }
    sort(vc.begin(), vc.end());
    l = tree[node].size() - 1;
    for (int j = ques[node].size() - 1; j >= 0; j--) {
      while (l >= 0 && tree[node][l].first > ques[node][j].first) {
        int f = tree[node][l].second + tree[node][l].first;
        int pos = upper_bound(vc.begin(), vc.end(), f - 1) - vc.begin();
        update(pos + 1, 1, vc.size());
        l--;
      }
      int g = income[ques[node][j].second] + ques[node][j].first;
      int pos = upper_bound(vc.begin(), vc.end(), g) - vc.begin();
      ans[ques[node][j].second] += query(pos);
    }
    l++;
    while (l < tree[node].size()) {
      int f = tree[node][l].second + tree[node][l].first;
      int pos = upper_bound(vc.begin(), vc.end(), f - 1) - vc.begin();
      update(pos + 1, -1, vc.size());
      l++;
    }
  }
}
vector<pair<int, int> > tp;
int main() {
  int i, j, k, l, m, n;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &price[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &stan[i]);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &bea[i]);
  }
  for (int i = 1; i <= m; i++) {
    scanf("%d", &income[i]);
  }
  tp.push_back(make_pair(-1, -1));
  for (int i = 1; i <= m; i++) {
    scanf("%d", &pref[i]);
    tp.push_back(make_pair(income[i], i));
  }
  sort(tp.begin(), tp.end());
  for (int i = 1; i <= n; i++) {
    int pos =
        upper_bound(tp.begin(), tp.end(), make_pair(price[i] - 1, INT_MAX)) -
        tp.begin();
    int pos2 = upper_bound(tp.begin(), tp.end(), make_pair(stan[i], INT_MAX)) -
               tp.begin();
    pos2--;
    if (pos <= pos2) update(1, 1, m, pos, pos2, make_pair(bea[i], price[i]));
  }
  for (int i = 1; i <= m; i++) {
    update2(1, 1, m, i, make_pair(pref[tp[i].second], tp[i].second));
  }
  process();
  for (int i = 1; i <= m; i++) {
    printf("%d ", ans[i]);
  }
}