n, k = map(int, input().split())
b = ([0]*n)
m = []
c = 0
for i in range(k):
    a = input()
    v = 0
    if a == '+':
        c += 1
        if len(m) == 0:
            v = 0
        if len(m) == 1:
            v = n-1
        if len(m) > 1:
            if b[0] == 0:
                v = 0
            elif b[n-1] == 0:
                v = n-1
            else:
                vm = 0;
                list.sort(m)
                for k in range(len(m)-1):
                    vv = m[k+1]-m[k]
                    if vv > vm:
                        vm = vv
                        v = round((m[k+1]+m[k])/2-0.1)
        list.append(m, v)
        b[v] = c
        print(v+1)
    else:
        h = int(a)*-1
        h = list.index(b, h)
        list.remove(m, h)
        b[h] = 0
