#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define REP(a) while(a--)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int in1,in2;
  while(cin>>in1>>in2,in1,in2){
    vector<char>in(in1+2,'\0');
    REP(in2){
      string s;
      cin>>s;
      if(s=="A"){
	rep(i,in1){
	  if(in[i+1]=='\0'){
	    in[i+1]='A';break;
	  }
	}
      }else if(s=="B"){
	bool han=false;
	for(int i=in1-1;i>=0;i--){
	  if(in[i+1]=='\0'&&in[i]!='A'&&in[i+2]!='A'){
	    han=true;in[i+1]='B';break;
	  }
	}
	if(!han)rep(i,in1)if(in[i+1]=='\0')in[i+1]='B';
      }else if(s=="C"){
	bool han=false;
	rep(i,in1)if(in[i+1]!='\0')han=true;
	if(!han){
	  if(in1%2)in[(in1+1)/2]='C';
	  else in[in1/2+1]='C';
	}else{
	  rep(i,in1)if(in[i+1]!='\0'){
	    bool ha=false;
	    rep(j,in1){
	      if(in[i+j+2]=='\0'){
		in[i+j+2]='C';
		ha=true;
		break;
	      }
	    }
	    if(ha)break;
	  }
	}
      }else if(s=="D"){
	int ans=0,ans2=0;
	vector<int>tmp;
	rep(i,in1)if(in[i+1]!='\0')tmp.pb(i+1);
	sort(all(tmp));
	if(tmp.size()==0)in[1]='D';
	else{
	  rep(i,in1)if(in[i+1]=='\0'){
	    int sa=99999;
	    rep(j,tmp.size())sa=min(sa,abs(i+1-tmp[j]));
	    if(ans<sa){ans=sa;ans2=i+1;}
	  }
	  in[ans2]='D';
	}
      }else 
    	cout<<"Error"<<endl;
    }
    rep(i,in1)
      if(in[i+1]=='\0')cout<<'#';
      else cout<<in[i+1];
    cout<<endl;
  }
}