#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <limits>
#include <cmath>
#include <cassert>

using namespace std;
using ll = long long;

const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, Q;
    while(cin >> N >> Q, N or Q)
    {
        vector<int> state(N, -1);
        while(Q--)
        {
            char ch; int id; cin >> ch >> id;
            if(ch == 's')
            {
                int w; cin >> w;
                int cnt = 0, place = 0;
                for(int i = 0; i < N; i++)
                {
                    if(state[i] != -1) cnt = 0, place = i + 1;
                    else
                    {
                        cnt++;
                        place = min(place, i);
                    }
                    if(cnt == w) break;
                }
                if(cnt == w)
                {
                    for(int i = place; i - place < w; i++)
                    {
                        state[i] = id;
                    }
                    cout << place << endl;
                }
                else cout << "impossible" << endl;
            }
            else
            {
                for(int i = 0; i < N; i++) if(state[i] == id) state[i] = -1;
            }
        }
        cout << "END" << endl;
    }
    return 0;
}


