#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#define endl '\n'
#define int ll
#define ve vector
#define pb push_back
#define all(x) x.begin() , x.end()
#define pii pair <int , int>
#define F first
#define S second
#define bpp __builtin_popcount
#define orok order_of_key
#define fob find_by_order
#define ins insert


using namespace std;
using namespace __gnu_pbds;


typedef long long ll;
typedef long double ld;

typedef tree < int, null_type, less < int >, rb_tree_tag, tree_order_statistics_node_update > oset;

oset p;
set < pair < int, pii > > st;


int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    #ifdef LOCAL
        freopen("input.txt" , "r" , stdin);
        freopen("output.txt" , "w" , stdout);
    #endif // LOCAL




    int n;
    cin >> n;


    int q;
    cin >> q;

    vector < int > add;
    int used[n + 1];
    fill(used , used + n + 1 , 0);
    ll kol = 0;
    while(q--){
        char c;
        cin >> c;

//
//        for(auto to : p)
//            cout << to << ' ';
//        cout << endl;

        if(c == '+'){
            if(kol == 0)
            {
                used[1] = 1;
                add.pb(1);
                ++ kol;
                continue;
            }
            if(kol == 1)
            {
                used[n] = 1;
                add.pb(n);
                ++ kol;
                continue;
            }
            ll mx = -1 , nom = 0;
            for(int i = 2;i < n;++ i)
            {
                if(used[i])continue;
                ll now = 0;
                for(int j = 1;j <= n;++ j)
                {
                    if(used[i - j] == 1 || used[i + j] == 1)
                    {
                        now = j - 1;
                        break;
                    }
                }
                if(mx < now)
                {
                    mx = now;
                    nom = i;
                }
            }
            add.pb(nom);
            used[nom] = 1;
            ++ kol;
        }
        else {
            ll x;
            cin >> x;
            -- x;
            used[add[x]] = 0;
            -- kol;
        }


    }

    for(auto to : add)
        cout << to << endl;



return 0;


}
