#initiating dict#
import math as m
alpha = list(map(int, input().split()))
dicts = {}
keys = range(alpha[0])
values = []
for i in range(alpha[0]):
    values.append(0)
for i in keys:
    dicts[i] = values[i]
dicts[0] = 1
input()
print(1)
people=1
var=0
for i in range(alpha[1]):
    beta = input()
    if "-" in beta:
        q=int(list(beta)[1])
        people-=1
        dicts[q]=0
    if '+' in beta:
        people+=1
        if people==2:
            print(alpha[0])
            var=alpha[0]-1
        elif people==1:
            print(1)
        else:
            if dicts[m.floor(var/2)] !=0:
                print(m.floor(var/2))
            else:
                print(alpha[0]-m.floor(var/2))