Accomodation
Watson is responsible for distribution of patients in a ward of a hospital. The ward contains N places, which are lined up in a row and sequentially numbered from 1 to N. To minimize morbidity patients should be placed as far from each other or ward’s entry as possible, and it is not allowed to relocate them. Watson has access to admission and discharging log. For each admission, Watson needs to find a place for new patient’s allocation. In order to do this, Watson is to select the most distant from other patients place. If there are several such places, he should minimize the number of patients located at this minimal distance. If there are still several places, he should choose the most distant place from entry.
Input
The first line contains 2 integers: N – numbers on places in the ward and Q – number of entries in the log. Following Q lines contain entries from the log: "0" – admission, "1 X" - discharging of the patient which has been admitted according to the log's entry number X (numeration is 1-based and includes both admissions and dischargings).
It is guaranteed that the patient that is being discharged is present in the hospital. It is also guaranteed that for every admission there will be at least one place available.
0 ≤ N, Q < 10^5.
Output
You need to print place number for every admission in the log.