Elevator#3008

Elevator

2 seconds
64 megabytes
Hard

In the center of New-Donetsk, a skyscraper with an extremely large number of floors has been built, including a large underground section. Entering from the street, a person arrives at floor . Floors above are numbered with positive integers, and those below with negative integers. The skyscraper is equipped with an elevator, but for certain reasons it cannot stop on some floors. The elevator has two buttons: "up" and "down". Pressing the "up" button makes the elevator ascend to the nearest floor where it can stop, and pressing the "down" button makes it descend to the nearest floor where it can stop. Pressing a button multiple times causes the elevator to perform the action that many times in a row, without stopping at intermediate floors. A boy named Vasya decided to take a ride in the elevator. He entered on the ground floor and started pressing the buttons.

Your task is to find the sequence of floors where the elevator stops after each of Vasya's commands.

Input

The first line contains two integers and (0 \leq K, N \leq 10^5): the number of floors where the elevator cannot stop, and the number of elevator movements, respectively.

The second line contains integers l_1, l_2, \dots, l_K (-10^9 \leq l_1 < \dots < l_K \leq 10^9), indicating the numbers of these floors. All these numbers are guaranteed to be different from .

The third line contains integers, each representing a command Vasya gave in the elevator. The sign of the number determines the button (positive for the "up" button, negative for the "down" button), and its absolute value is the number of presses. All numbers are at most 10^6 in absolute value.

Output

Output numbers: the numbers of the floors where the elevator stops after each of Vasya's commands.

Examples

Example 1

Loading
Loading