#include <bits/stdc++.h>
using namespace std;
// 12:46

string chair;


int goA(char c){
	for(int i = 0 ; i < chair.size() ; i++)
		if( chair[i] == '#'){
			chair[i] = c;
			return 1;
		}
	return 0;
}
int goB(char c){
	for(int i = chair.size() -1  ; i >= 0 ; i--)
		if( chair[i] == '#' && (!i||chair[i-1]!='A') && (i+1==chair.size()||chair[i+1]!='A') ){
			chair[i] = c;
			return 1;
		}
	return goA(c);
}
int goC(char c){
	if( count(chair.begin(),chair.end(),'#') == chair.size() ){
		if( chair.size() % 2 ) chair[(1+chair.size())/2-1] = c;
		else chair[chair.size()/2] = c;
		return 1;
	}
	for(int i = 0 ; i < chair.size() ; i++)
		if( chair[i] != '#'){
			for(int j = 1 ; j >= -1 ; j--){
				if( i+j >= 0 && i+j < chair.size() && chair[i+j] == '#' ){
					chair[i+j] = c;
					return 1;
				}
			}
		}

	return 0;
}
int goD(char c){
	int pos;
	int dst = -2e9;
	for(int i = 0 ; i < chair.size() ; i++){
		if( chair[i] == '#' ){
			int dist = 1e9;
			for(int j = 0 ; j < chair.size() ; j++)
				if( chair[j] != '#') dist = min(dist,abs(i-j));

			if( dst < dist){
				dst = dist;
				pos = i;
			}
		}
	}
	chair[pos] = c;
	return 1;
}


int main(){
	int n,m;
	while( cin >> n >> m && n ){
		chair = string(n,'#');
		for(int i = 0 ; i < m ; i++){
			char c; cin >> c;
			if( c == 'A' ) goA(c);
			if( c == 'B' ) goB(c);
			if( c == 'C' ) goC(c);
			if( c == 'D' ) goD(c);
		}
		cout << chair << endl;
	}
}