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 JAVA):

Solution:
import java.io.*;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class F {
    static class SumSegmentTree {
        private int size;
        private final int[] a;
        private final int ABSENT_VALUE = 0;

        SumSegmentTree(int n) {
            size = 1;
            while (size <= n) {
                size *= 2;
            }
            a = new int[2 * size];
        }

        void add(int i, int value) {
            for (i += size; i > 0; i /= 2) {
                a[i] += value;
            }
        }

        int getSum(int l, int r) {
            int sum = ABSENT_VALUE;
            for (l += size, r += size; l < r; l /= 2, r /= 2) {
                if (l % 2 == 1) {
                    sum += a[l++];
                }
                if (r % 2 == 1) {
                    sum += a[--r];
                }
            }
            return sum;
        }
    }



    public static void main(String[] args) throws IOException {
        try (Input input = new StandardInput(); PrintWriter writer = new PrintWriter(System.out)) {
            int n = input.nextInt(), m = input.nextInt();
            int[] p = input.readIntArray(n);
            int[] s = input.readIntArray(n);
            int[] b = input.readIntArray(n);
            int[] inc = input.readIntArray(m);
            int[] pref = input.readIntArray(m);
            class Point {
                private final int x, y;
                private final int personId;


                private Point(int x, int y, int personId) {
                    this.x = x;
                    this.y = y;
                    this.personId = personId;
                }

                private Point(int x, int y) {
                    this(x, y, 0);
                }

                private int upperBoundProjection() {
                    return y - x;
                }

                private int lowerBoundProjection() {
                    return y + x;
                }
            }
            Point[] tmp = new Point[n + m];
            for (int i = 0; i < n; i++) {
                tmp[i] = new Point(p[i], b[i]);
            }
            for (int i = 0; i < m; i++) {
                tmp[n + i] = new Point(inc[i], pref[i], i);
            }
            class Mapper {
                private Map<Integer, Integer> map(Point[] points, Function<Point, Integer> toValue) {
                    List<Integer> list = Stream.of(points)
                            .map(toValue)
                            .sorted()
                            .distinct()
                            .collect(Collectors.toList());
                    Map<Integer, Integer> result = new HashMap<>();
                    for (int i = 0; i < list.size(); i++) {
                        result.put(list.get(i), i);
                    }
                    return result;
                }
            }
            Mapper mapper = new Mapper();
            Map<Integer, Integer> lowerBoundMap = mapper.map(tmp, Point::lowerBoundProjection);
            Map<Integer, Integer> upperBoundMap = mapper.map(tmp, Point::upperBoundProjection);
            SumSegmentTree lowerBoundTree = new SumSegmentTree(lowerBoundMap.size());
            SumSegmentTree upperBoundTree = new SumSegmentTree(upperBoundMap.size());
            final int DISH_START = 0, DISH_END = 3, PERSON = 1;
            class Event implements Comparable<Event> {
                private final Point point;
                private final int eventType;
                private final int x;

                private Event(Point point, int eventType, int x) {
                    this.point = point;
                    this.eventType = eventType;
                    this.x = x;
                }

                @Override
                public int compareTo(Event that) {
                    if (this.x == that.x) {
                        return this.eventType - that.eventType;
                    }
                    return this.x - that.x;
                }
            }
            Event[] events = new Event[2 * n + m];
            for (int i = 0; i < n; i++) {
                events[i] = new Event(tmp[i], DISH_START, p[i]);
                events[n + i] = new Event(tmp[i], DISH_END, s[i]);
            }
            for (int i = 0; i < m; i++) {
                events[2 * n + i] = new Event(tmp[n + i], PERSON, inc[i]);
            }
            Arrays.sort(events);
            int[] answer = new int[m];
            for (Event event : events) {
                if (event.eventType == DISH_START) {
                    upperBoundTree.add(upperBoundMap.get(event.point.upperBoundProjection()), 1);
                    lowerBoundTree.add(lowerBoundMap.get(event.point.lowerBoundProjection()), 1);
                } else if (event.eventType == DISH_END) {
                    upperBoundTree.add(upperBoundMap.get(event.point.upperBoundProjection()), -1);
                    lowerBoundTree.add(lowerBoundMap.get(event.point.lowerBoundProjection()), -1);
                } else {
                    int totalDishes = upperBoundTree.a[1];
                    int lowerBound = lowerBoundMap.get(event.point.lowerBoundProjection());
                    totalDishes -= lowerBoundTree.getSum(lowerBound + 1, lowerBoundTree.size);
                    int upperBound = upperBoundMap.get(event.point.upperBoundProjection());
                    totalDishes -= upperBoundTree.getSum(0, upperBound);
                    answer[event.point.personId] = totalDishes;
                }
            }
            for (int x : answer) {
                writer.print(x + " ");
            }
            writer.println();
        }
    }

    interface Input extends Closeable {
        String next() throws IOException;

        default int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        default long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        default int[] readIntArray() throws IOException {
            return readIntArray(nextInt());
        }

        default int[] readIntArray(int size) throws IOException {
            int[] array = new int[size];
            for (int i = 0; i < array.length; i++) {
                array[i] = nextInt();
            }
            return array;
        }
    }

    private static class StandardInput implements Input {
        private final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        private StringTokenizer stringTokenizer;

        @Override
        public void close() throws IOException {
            reader.close();
        }

        @Override
        public String next() throws IOException {
            if (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                stringTokenizer = new StringTokenizer(reader.readLine());
            }
            return stringTokenizer.nextToken();
        }
    }
}