#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>

using namespace std;

struct Info{
	Info(){
		country = '#';
	}
	char country;
};

void func(int n,int m){
	Info info[n];
	char tmp[2];
	int maximum,most_left_index,pre_index,div,left_dist,work[n];
	bool FLG;

	for(int loop = 0; loop < m; loop++){
		scanf("%s",tmp);

		switch(tmp[0]){
		case 'A':
			for(int i = 0; i < n; i++){
				if(info[i].country == '#'){
					info[i].country = 'A';
					break;
				}
			}
			break;
		case 'B':
			FLG = false;

			if(info[n-1].country == '#' && info[n-2].country != 'A'){
				info[n-1].country = 'B';
				break;
			}

			for(int i = n-2; i >= 1; i--){
				if(info[i].country == '#' && info[i-1].country != 'A' && info[i+1].country != 'A'){
					info[i].country = 'B';
					FLG = true;
					break;
				}
			}

			if(FLG)break;

			if(info[0].country == '#' && info[1].country != 'A'){
				info[0].country = 'B';
				break;
			}

			for(int i = 0; i < n; i++){
				if(info[i].country == '#'){
					info[i].country = 'B';
					break;
				}
			}
			break;
		case 'C':
			if(loop == 0){
				if(n%2 == 1){
					info[(n+1)/2].country = 'C';
				}else{
					info[(n/2)+1].country = 'C';
				}
			}else{
				FLG = false;
				if(info[0].country != '#' && info[1].country == '#'){
					info[1].country = 'C';
					break;
				}
				for(int i = 1; i <= n-2; i++){
					if(info[i].country != '#'){
						if(info[i+1].country == '#'){
							info[i+1].country = 'C';
							FLG = true;
							break;
						}else if(info[i-1].country == '#'){
							info[i-1].country = 'C';
							FLG = true;
							break;
						}
					}
					if(FLG)break;
				}
				if(FLG)break;

				if(info[n-1].country != '#' && info[n-2].country == '#'){
					info[n-2].country = 'C';
					break;
				}
			}
			break;
		case 'D':

			if(loop == 0){
				info[0].country = 'D';
			}else{

				for(int i = 0; i < n; i++)work[i] = 100000;
				for(int i = 0; i < n; i++){
					if(info[i].country != '#'){
						for(int k = 0; k < n; k++){
							work[k] = min(work[k],abs(k-i));
						}
					}
				}

				div = 0;

				for(int i = 0; i < n; i++){
					if(info[i].country == '#' &&  div < work[i]){
						most_left_index = i;
						div = work[i];
					}
				}

				info[most_left_index].country = 'D';

			}

			break;
		}
	}

	for(int i = 0; i < n; i++)printf("%c",info[i].country);
	printf("\n");
}

int main(){

	int n,m;
	while(true){
		scanf("%d %d",&n,&m);
		if(n == 0 && m == 0)break;

		func(n,m);

	}

    return 0;
}