Elevator
In the heart of New-Donetsk city, a towering skyscraper has been constructed, featuring an extensive number of floors both above and below ground level. When entering from the street, a person arrives at floor number 0. Floors above this level are numbered positively, while those below are numbered negatively. The skyscraper is equipped with an elevator, but it cannot stop on certain floors. The elevator is operated using two buttons: "up" and "down." Pressing the "up" button causes the elevator to ascend to the nearest floor where it can stop, while pressing the "down" button makes it descend to the nearest such floor. If a button is pressed multiple times, the elevator performs the action the specified number of times consecutively, without halting at any intermediate floors. A boy named Vasya decided to take a ride in this elevator. He entered on the ground floor and began pressing the buttons.
Your task is to write a program that determines the sequence of floors where Vasya will stop.
Input
The first line contains two integers K and N (0 ≤ K, N ≤ 10^5), representing the number of floors where the elevator does not stop, and the number of elevator movements, respectively. The second line lists K integers l_1, l_2, ..., l_K (-10^9 ≤ l_1 < ... < l_K ≤ 10^9), indicating the numbers of these non-stopping floors. It is guaranteed that none of these numbers is 0. The third line contains N integers, each representing a command Vasya issued while in the elevator. The sign of the number indicates the button pressed (positive for "up" and negative for "down"), and the absolute value indicates the number of presses. All numbers do not exceed 10^6 in absolute value.
Output
Output N numbers, each representing the floor number where the elevator stopped after executing each of Vasya's commands.