Candies#2365

Candies

2 seconds
64 megabytes
Easy

Rabbit is having a birthday! He invited guests. To ensure the guests have fun, Rabbit bought boxes of candies. Rabbit loves variety, so the candies are all different. The -th box contains a_i candies.

On the set day, guests begin arriving at Rabbit's house. Each guest is characterized by their boldness b_i. This means that when a guest enters Rabbit's house and sees the candy boxes, they take one candy from each box that contains at least b_i candies. For example, if Winnie-the-Pooh's boldness is one, he would take one candy from each box.

In the evening, after the guests have left, Rabbit is curious about how many candies each guest ate. Help him find out.

Input

The first line contains an integer (1 \leq n \leq 100000) — the number of candy boxes. The next line contains natural numbers: a_i (1 \leq a_i \leq 10^9) — the number of candies in each box.

The next line contains an integer (1 \leq m \leq 100000) — the number of guests. The fourth and final line contains numbers: b_i (1 \leq b_i \leq 10^9) — the boldness of each guest.

Output

Print lines. The -th line should contain the number of candies eaten by the -th guest.

Examples

Example 1

Loading
Loading