#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
vector<int> data;
int n,N;

int getLeft(){
	rep(i,n)if(data[i] == 0)return i;
	rep(i,n)cout << data[i] << " ";cout << endl;
	return -1;
}

int B(){
	for(int i=n-1;i>=0;i--){
		if(data[i] == 0 && data[i+1] != 1 && data[i-1] != 1)return i;
	}
	return getLeft();
}
int C(){
	bool f = true;
	rep(i,N)f &=(data[i+1]==0);
	if(f)return (N&1?n/2:N/2+1);
	
	rep(i,n){
		if(data[i] == 0 && data[i+1] != -1 && data[i+1])return i;
		if(data[i] == 0 && data[i-1] != -1 && data[i-1])return i;
	}
}

int most(int pos,int a){
	int i = 0;
	while(!data[pos+i*a]){
		i++;
		if(data[pos+i*a] == -1)return 999999;
	}
	return i;
}
int D(){
	int good , val = -1;
	rep(i,n){
		if(data[i] == 0){
			int t = min( most(i,-1) , most(i,1) );
			if(t > val){
				val = t;
				good = i;
			}
		}
	}
	return good;
}
int main(){
	string tab = "#ABCD";
	int m;
	while(cin >> n >> m , n ){
		N = n ; n++;
		data.resize(N+2);
		fill(data.begin(),data.end(),0);
		data[0] = -1 , data[n] = -1;
		
		rep(i,m){
			char c; cin >> c;
			switch(c){
			case 'A':
				data[getLeft()] = 1;
				break;
			case 'B':
				data[B()] = 2;
				break;
			case 'C':
				data[C()] = 3;
				break;
			case 'D':
				data[D()] = 4;
				break;
			}
		}
		rep(i,N){
			int t = data[i+1];
			cout << tab[t];
		}
		cout << endl;
	}
}