#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DEBUG 0
#define rep(i,a,f) for(int i=(a);i<(f);i++)
#define rrep(i,a,f) for(int i=(f)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define dump(o) if(DEBUG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DEBUG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
using ll = long long; using ull = unsigned long long; using pii = pair<int, int>;
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
static const int MOD = 1e9 + 7;

signed main() {
	bool f[110] = {};
	int b[110] = {}, w[110] = {};
	for (int W, Q; cin >> W >> Q && (W || Q);) {
		fill(f, f + W, false);
		rep(i, 0, Q) {
			char c; int id; cin >> c >> id;
			if (c == 's') {
				cin >> w[id];
				dump(w[id]);
				bool flag2 = false;
				rep(j, 0, W - w[id] + 1) {
					dump(j);
					bool flag = false;
					rep(k, j, j + w[id]) {
						if (f[k]) {
							flag = true;
							break;
						}
					}
					if (flag)continue;
					flag2 = true;
					rep(k, j, j + w[id])f[k] = true;
					cout << j << endl;
					b[id] = j;
					dumpc(f);
					break;
				}
				if (!flag2)cout << "impossible" << endl;
			}
			else {
				rep(k, b[id], b[id] + w[id])f[k] = false;
			}
		}
		cout << "END" << endl;
	}
	return 0;
}