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;
const int MAXN = 100005;
int p[MAXN], s[MAXN], b[MAXN], inc[MAXN], pref[MAXN], res[MAXN];
int n, m;
struct Node *nil = 0;
struct Node {
  int val, sz, h;
  Node *lc, *rc;
  Node() {}
  Node(int x) : val(x), sz(1), h(rand()), lc(NULL), rc(NULL) {}
  void update() { sz = (lc ? lc->sz : 0) + (rc ? rc->sz : 0) + 1; }
} pool[MAXN * 60];
int cnt = 0;
inline Node *newnode(int x) {
  pool[cnt] = Node(x);
  return pool + cnt++;
}
Node *merge(Node *a, Node *b) {
  if (!a) return b;
  if (!b) return a;
  if (a->h < b->h) {
    a->rc = merge(a->rc, b), a->update();
    return a;
  } else {
    b->lc = merge(a, b->lc), b->update();
    return b;
  }
}
pair<Node *, Node *> split(Node *p, int k) {
  if (!p) return make_pair(nil, nil);
  if (k >= p->val) {
    pair<Node *, Node *> y = split(p->rc, k);
    p->rc = y.first, p->update();
    return make_pair(p, y.second);
  } else {
    pair<Node *, Node *> y = split(p->lc, k);
    p->lc = y.second, p->update();
    return make_pair(y.first, p);
  }
}
inline void insert(Node *&root, int k) {
  pair<Node *, Node *> y = split(root, k);
  root = merge(merge(y.first, newnode(k)), y.second);
}
inline void erase(Node *&root, int k) {
  pair<Node *, Node *> x = split(root, k - 1);
  pair<Node *, Node *> y = split(x.second, k);
  if (y.first) y.first = merge(y.first->lc, y.first->rc);
  root = merge(x.first, merge(y.first, y.second));
}
inline int query(Node *&root, int k) {
  pair<Node *, Node *> y = split(root, k - 1);
  int ret = (y.second ? y.second->sz : 0);
  root = merge(y.first, y.second);
  return ret;
}
struct Op {
  int type, id, pos;
  Op() {}
  Op(int a, int b, int c) : type(a), id(b), pos(c) {}
};
bool operator<(const Op &a, const Op &b) {
  return (a.pos == b.pos ? a.type < b.type : a.pos < b.pos);
}
vector<Op> op;
map<int, int> dict;
int tmp = 0;
void init_dict() {
  for (int i = 1; i <= n; i++) dict[p[i] + b[i]] = 0;
  for (int i = 1; i <= m; i++) dict[inc[i] + pref[i]] = 0;
  for (auto &x : dict) x.second = ++tmp;
}
Node *bit[MAXN << 1];
inline int lowbit(int x) { return x & -x; }
inline void add(int x, int k) {
  x = dict[x];
  for (int i = x; i <= tmp; i += lowbit(i)) insert(bit[i], k);
}
inline void del(int x, int k) {
  x = dict[x];
  for (int i = x; i <= tmp; i += lowbit(i)) erase(bit[i], k);
}
inline int query(int x, int k) {
  x = dict[x];
  int ret = 0;
  for (int i = x; i > 0; i ^= lowbit(i)) ret += query(bit[i], k);
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  srand(2333);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> p[i];
  for (int i = 1; i <= n; i++) cin >> s[i];
  for (int i = 1; i <= n; i++) cin >> b[i];
  for (int i = 1; i <= m; i++) cin >> inc[i];
  for (int i = 1; i <= m; i++) cin >> pref[i];
  init_dict();
  for (int i = 1; i <= n; i++) {
    op.push_back(Op(0, i, p[i]));
    op.push_back(Op(1, i, s[i] + 1));
  }
  for (int i = 1; i <= m; i++) op.push_back(Op(2, i, inc[i]));
  sort(op.begin(), op.end());
  for (auto x : op) {
    if (x.type == 0) {
      int id = x.id;
      add(b[id] + p[id], b[id] - p[id]);
    } else if (x.type == 1) {
      int id = x.id;
      del(b[id] + p[id], b[id] - p[id]);
    } else {
      int id = x.id;
      res[id] = query(pref[id] + inc[id], pref[id] - inc[id]);
    }
  }
  for (int i = 1; i <= m; i++) cout << res[i] << " ";
  cout << endl;
  return 0;
}