Cybermen have attacked Earth and the Doctor has to defend Earth. He has constructed a device that can corrupt their system and stop them from attacking. There are N building arranged in a straight line. Assume that they are on x-axis and you will be given their x co-ordinates and their heights. There are few cybermen on each of these buildings and their count is given by the array A of lenth N. The Doctor is on one of these buildings denoted by CURR. He uses the device to disarm the cybermen on the building itself and those that are on the right side of CURR. But, the device has a limitation. It's effect cannot penetrate walls head-on. In other words, cybermen of the first building on right having height greater than CURR and beyond will not be effected by the device. You are required to calculate the number of cybermen disarmed by the device.
Input Format:
First line consists of N, number of buildings.
Next line consists of N integers where ith integer denotes the height of ith building.
Next line consists of N integers where ith integer denotes the number of cybermen on ith building.
Next line consists of an integer Q, number of queries.
Next Q lines each consisting of an integer CURR, denoting the building on which the device is placed.
Output Format:
Output exactly Q lines with each line containing the number of cybermen for that query.
Constraints:
1≤N≤105
1≤heights≤109
1≤ number of cybermen on each building ≤104
1≤Q≤105
1≤CURR≤N
When Doctor is on building with index 1, the device will work upto building indexed 3, becuse building indexed 4 is having height 4 which is greater than 3 and is first on right to have height greater than 3. So, total cybermen disamed will be 2+3+4 = 9.
When Doctor is on building indexed 3, device will only work on that building only because next one is of greater height. So, total cybermen disarmed is 4.