#include <bits/stdc++.h>
using namespace std;
int main(){
    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    int n, k;
    cin >> n >> k;
    string mas[k];
    for(int i = 0; i < k; i++) {
        cin >> mas[i];
    }
    vector <int> places(n, 0);
    for(int i = 0; i < k; ++i) {
        string s = mas[i];
        if(s == "+" && i != 0) {
            int one = 0;
            int two = 0;
            int place1 = 0;
            int maxi = -99999;
            int place = 0;
            for(int j = 0; j < n; j++) {
                if (places[j] == 0) {
                    int h = j;
                    place = j;
                    while(places[h] != 1 && h < n) {
                        ++one;
                        h++;
                    }
                    while(places[h] != 1 && h > 0) {
                        two++;
                        h--;
                    } 
                    
                }
                int mini = min(one, two);
                if(mini > maxi) {
                    maxi = mini;
                    place1 = place;
                }
            }
            cout << place1 + 1 << endl;
            places[place1] = 1;
        }else {
            if(i == 0) {
                cout << 1 << endl;
                continue;
            }else{
                int num = 0;
                for(int h = 1; h < s.size() - 1; h++) {
                    string dv = "";
                    dv+= s[h];
                    num *= 10;
                    num += stoi(dv);
                    
                }
                num /= 10;
                places[num] = 0;
            }
            
        }
    }
}
