#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>

using namespace std;

#define reps(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reps(i,0,n)

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

const int INF = 1001001001;

void sit(char c, char chair[], int n)
{
	if(c == 'A'){
		rep(i, n){
			if(chair[i] == '#'){
				chair[i] = 'A';
				return;
			}
		}
	}
	else if(c == 'B'){
		int pos = -1;
		for(int i=n-1; i>=0; --i){
			if(chair[i] == '#'){
				pos = i;
				if(i!=0 && chair[i-1]=='A')
					continue;
				if(i!=n-1 && chair[i+1]=='A')
					continue;
				chair[i] = 'B';
				return;
			}
		}
		chair[pos] = 'B';
	}
	else if(c == 'C'){
		rep(i, n){
			if(chair[i] != '#'){
				if(i!=n-1 && chair[i+1]=='#'){
					chair[i+1] = 'C';
					return;
				}
				if(i!=0 && chair[i-1]=='#'){
					chair[i-1] = 'C';
					return;
				}
			}
		}
		chair[n/2] = 'C';
	}
	else{
		int B = 0;
		int Bid;
		rep(i, n){
			int dist = INF;
			rep(j, n){
				if(chair[j] != '#')
					dist = min(dist, abs(i-j));
			}
			if(dist > B){
				B = dist;
				Bid = i;
			}
		}
		chair[Bid] = 'D';
	}
}

int main()
{
	int n, m;
	while(scanf("%d%d", &n, &m), n){
		char chair[100];
		fill(chair, chair+n, '#');
		rep(i, m){
			char c;
			scanf(" %c", &c);
			sit(c, chair, n);
		}
		rep(i, n)
			putchar(chair[i]);
		puts("");
	}
	return 0;
}