#include<iostream>
#define rep(i,n) for(int i=0;i<n;i++)
#define ck(a) (0<=a&&a<n)
using namespace std;
int main(){
	int n,m,s[100],f; char b[2];
	while(cin>>n>>m,n){
		rep(i,n)s[i]=0;
		rep(i,m){
			cin>>b;
			switch(b[0]){
			case 'A':
				rep(i,n)if(!s[i]){
					s[i]=1; break;
				}
				break;
			case 'B':
				f=1;
				rep(i,n)if(!s[n-1-i])
				if((!ck(n-2-i)||s[n-2-i]!=1)&&(!ck(n-i)||s[n-i]!=1)){
					s[n-1-i]=2,f=0; break;
				}
				if(f)rep(i,n)if(!s[n-1-i]){
					s[n-1-i]=2; break;
				}
				break;
			case 'C':
				f=1;
				rep(i,n)if(s[i]&&(ck(i+1)&&!s[i+1]||ck(i-1)&&!s[i-1])){
					if(ck(i+1)&&!s[i+1])s[i+1]=3;
					else s[i-1]=3;
					f=0; break;
				}
				if(f)s[n/2]=3;
				break;
			case 'D':
				int d,md=0,mdi=0;
				rep(i,n)if(!s[i]){
					for(d=1;i-d>=0||i+d<n;d++)if(ck(i+d)&&s[i+d]||ck(i-d)&&s[i-d])break;
					if(d>md)md=d,mdi=i;
				}
				s[mdi]=4;
				break;
			}
		}
		rep(i,n)cout<<char(s[i]?'A'-1+s[i]:'#'); cout<<endl;
	}
	return 0;
}