#include <iostream>
#include <string>

using namespace std;

const int inf = 1e9;

int main(){
	int n, m;
	while(cin >> n >> m, n+m){
		string s;
		for(int i=0; i< n; i++) s+= "#";
		for(int i=0; i< m; i++){
			string t; cin >> t;
			if(t == "A"){
				for(int j=0; j< n; j++) if(s[j] == '#'){s[j] = 'A'; break;}
			}
			if(t == "B"){
				bool possible = false;
				for(int j=n-1; 0 <= j; j--){
					if(j == n-1 && s[j-1] != 'A'){s[j] = 'B'; possible = true; break;}
					else if(j == 0 && s[j+1] != 'A'){s[j] = 'B'; possible = true; break;}
					else if(s[j-1] != 'A' && s[j+1] != 'A'){s[j] = 'B'; possible = true; break;}
				}
				if(!possible){
					for(int j=0; j< n; j++){
						if(s[j] == '#'){s[j] = 'B'; break;}
					}
				}
			}
			if(t == "C"){
				bool possible = false;
				for(int j=0; j < n-1; j++){
					if(s[j] != '#' && s[j+1] == '#'){s[j+1] = 'C'; possible = true; break;}
				}
				if(!possible){
					for(int j= n-1; 1 <= j; j--){
						if(s[j] != '#' && s[j-1] == '#'){s[j-1] = 'C'; possible = true; break;}
					}
				}
				if(!possible){
					s[n/2] = 'C';
				}
			}
			if(t == "D"){
				int maxd = 0, p = 0;
				for(int j=0; j < n; j++){
					if(s[j] != '#') continue;
					int d = 0, idx = j;
					while(0 <= idx && s[idx] == '#') idx--;
					d = (idx == -1 ? inf : j-idx);
					idx = j;
					while(idx < n && s[idx] == '#') idx++;
					d = max(d, (idx == n ? inf : idx-j));
					if(maxd < d){maxd = d; p = j;}
				}
				s[p] = 'D';
			}
		}
		cout << s << endl;
	}
}