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;
template <class T>
inline void amin(T &x, const T &y) {
  if (y < x) x = y;
}
template <class T>
inline void amax(T &x, const T &y) {
  if (x < y) x = y;
}
template <class Iter>
void rprintf(const char *fmt, Iter begin, Iter end) {
  for (bool sp = 0; begin != end; ++begin) {
    if (sp)
      putchar(' ');
    else
      sp = true;
    printf(fmt, *begin);
  }
  putchar('\n');
}
template <class T>
struct Fenwick {
  int n;
  T *d;
  Fenwick() : n(0), d(NULL) {}
  Fenwick(int n_) : n(n_) { d = new T[n_](); }
  Fenwick(const Fenwick &y) : n(y.n) {
    d = new T[n];
    memcpy(d, y.d, sizeof(T) * n);
  }
  ~Fenwick() {
    delete[] d;
    d = NULL;
    n = 0;
  }
  friend void swap(Fenwick &x, Fenwick &y) {
    swap(x.n, y.n);
    swap(x.d, y.d);
  }
  Fenwick &operator=(Fenwick y) {
    swap(*this, y);
    return *this;
  }
  inline void add(int i, const T &x) {
    for (; i < n; i |= i + 1) d[i] += x;
  }
  inline T sum(int r) {
    T s = T();
    for (; r; r &= r - 1) s += d[r - 1];
    return s;
  }
  T sum(int l, int r) { return sum(r) - sum(l); }
};
const int SIZE = 100011;
int N, M;
int P[SIZE], S[SIZE], B[SIZE];
int inc[SIZE], pref[SIZE];
vector<int> Bs;
struct Seg {
  vector<int> v;
  Fenwick<int> f;
  void build() {
    sort(v.begin(), v.end());
    f = Fenwick<int>(v.size());
  }
  void add(int x, int val) {
    int k = lower_bound(v.begin(), v.end(), x) - v.begin();
    ;
    f.add(k, val);
  }
  int sum(int val) {
    int k = upper_bound(v.begin(), v.end(), val) - v.begin();
    ;
    return f.sum(k);
  }
} seg[SIZE];
void clear() {
  for (int i = 0, i_len = (SIZE); i < i_len; ++i) seg[i].v.clear();
}
void SAdd(int i, int x) {
  for (; i < SIZE; i |= i + 1) seg[i].v.push_back(x);
}
void SInc(int i, int x, int val) {
  for (; i < SIZE; i |= i + 1) {
    seg[i].add(x, val);
  }
}
int query(int r, int val) {
  int s = 0;
  for (; r; r &= r - 1) s += seg[r - 1].sum(val);
  return s;
}
void build() {
  for (int i = 0, i_len = (SIZE); i < i_len; ++i) seg[i].build();
}
pair<int, int> EvP[SIZE];
pair<int, int> EvS[SIZE];
pair<int, int> EvI[SIZE];
int ans[SIZE];
void MAIN() {
  scanf("%d%d", &N, &M);
  for (int i = 0, i_len = (N); i < i_len; ++i) scanf("%d", P + i);
  for (int i = 0, i_len = (N); i < i_len; ++i) scanf("%d", S + i);
  for (int i = 0, i_len = (N); i < i_len; ++i) scanf("%d", B + i);
  for (int i = 0, i_len = (M); i < i_len; ++i) scanf("%d", inc + i);
  for (int i = 0, i_len = (M); i < i_len; ++i) scanf("%d", pref + i);
  for (int i = 0, i_len = (N); i < i_len; ++i) {
    EvP[i] = make_pair(P[i], i);
    EvS[i] = make_pair(S[i], i);
  }
  sort(EvP, EvP + N);
  sort(EvS, EvS + N);
  for (int i = 0, i_len = (M); i < i_len; ++i) EvI[i] = make_pair(inc[i], i);
  sort(EvI, EvI + M);
  for (int t = 0, t_len = (2); t < t_len; ++t) {
    Bs.assign(B, B + N);
    sort(Bs.begin(), Bs.end());
    Bs.erase(unique(Bs.begin(), Bs.end()), Bs.end());
    clear();
    for (int i = 0, i_len = (N); i < i_len; ++i) {
      int k = lower_bound(Bs.begin(), Bs.end(), B[i]) - Bs.begin();
      SAdd(k, P[i] - B[i]);
    }
    build();
    int p_i = 0, s_i = 0;
    for (int i = 0, i_len = (M); i < i_len; ++i) {
      int inc_ = EvI[i].first;
      int pref_ = pref[EvI[i].second];
      do {
      } while (0);
      while (p_i < N && EvP[p_i].first <= inc_) {
        int id = EvP[p_i].second;
        do {
        } while (0);
        int k = lower_bound(Bs.begin(), Bs.end(), B[id]) - Bs.begin();
        SInc(k, P[id] - B[id], 1);
        p_i++;
      }
      while (s_i < N && EvS[s_i].first < inc_) {
        int id = EvS[s_i].second;
        do {
        } while (0);
        int k = lower_bound(Bs.begin(), Bs.end(), B[id]) - Bs.begin();
        SInc(k, P[id] - B[id], -1);
        s_i++;
      }
      {
        int k = lower_bound(Bs.begin(), Bs.end(), pref_ + t) - Bs.begin();
        ans[EvI[i].second] += query(k, inc_ - pref_);
      }
    }
    for (int i = 0, i_len = (N); i < i_len; ++i) B[i] = -B[i];
    for (int j = 0, j_len = (M); j < j_len; ++j) pref[j] = -pref[j];
  }
  rprintf("%d", ans, ans + M);
}
int main() {
  int TC = 1;
  for (int tc = 0, tc_len = (TC); tc < tc_len; ++tc) MAIN();
  return 0;
}