#include<bits/stdc++.h>
using namespace std;
int main()
{
	int N,M;
	while(true){
		scanf("%d%d",&N,&M);
		if(N==0&&M==0)return 0;
		int seats[10009];
		for(int i=0;i<10009;i++){
			seats[i]=0;
		}
		
		for(int i=0;i<M;i++){
			string S;
			cin >> S;
			if(S=="A"){
				for(int j=0;j<N;j++){
					if(seats[j]==0){
						seats[j]=1;
						break;
					}
				}
			}
			else if(S=="B"){
				bool F=true;
				for(int j=N-1;j>=0;j--){
					if(F&&(j==0||seats[j-1]!=1)&&(j==N-1||seats[j+1]!=1)&&seats[j]==0){
						seats[j]=2;F=false;
					}
				}
				if(F){
					for(int j=0;j<N;j++){
						if(seats[j]==0){
							seats[j]=2;
							break;
						}
					}
				}
			}
			else if(S=="C"){
				bool F=true;bool FF=true;
				for(int j=0;j<N;j++){
					if(seats[j]!=0){
						FF=false;
					}
				}
				if(FF){
					seats[N/2]=3;
					F=false;
				}
				if(!F)continue;
				for(int j=0;j<N;j++){
					if(seats[j]!=0){
						if(F&&j!=N-1&&seats[j+1]==0){
							seats[j+1]=3;F=false;
						}
						else if(F&&j!=0&&seats[j-1]==0){
							seats[j-1]=3;F=false;
						}
					}
				}
			}
			else{
				int maxd=-1,maxi;
				bool F=true;
				for(int i=0;i<N;i++){
					if(seats[i]!=0)F=false;
				}
				if(F){
					seats[0]=4;
					continue;
				}
				for(int i=0;i<N;i++){
					int d=0;
					if(seats[i]!=0)d=-114;
					int l=i;int r=i;
					while((l<0||seats[l]==0)&&(r>=N||seats[r]==0)){
						d++;l--;r++;
					}
					if(maxd<d){
						maxd=d;
						maxi=i;
					}
				}
				seats[maxi]=4;
			}
			
		}
		for(int i=0;i<N;i++){
				if(seats[i]==0)printf("#");
				if(seats[i]==1)printf("A");
				if(seats[i]==2)printf("B");
				if(seats[i]==3)printf("C");
				if(seats[i]==4)printf("D");
			}
			printf("\n");
	}
}