#include<stdio.h>
int main(){
  int n,m,i,j,a,b;
  char c;
  while(scanf("%d %d",&n,&m),n||m){
    char w[101]={0};
    while(m--){
      scanf(" %c %d %d",&c,&a,&b);
      a++;
      if(c=='s'){
	for(i=0;i+b<=n;i++){
	  if(w[i])continue;
	  for(j=0;j<b;j++){
	    if(w[i+j])break;
	  }
	  if(j==b){
	    printf("%d\n",i);
	    for(j=0;j<b;j++)w[i+j]=a;
	    break;
	  }
	  i+=j-1;
	}
	if(i+b>n)printf("impossible\n");
      }
      else{
	for(i=0;w[i]-a;i++);
	for(;w[i]==a;i++)w[i]=0;
      }
    }
    printf("END\n");
  }
  return 0;
}
	  
	   