#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second

template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pll> pip;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS  = 1e-9;

int n, m;
int seet[100];

int main() {
	
	while (cin >> n >> m, n || m) {
		memset(seet, -1, sizeof(seet));
		REP(t, m) {
			char c; scanf(" %c", &c);
			
			bool ok = false;
			
			switch (c) {
				case 'A':
					REP(i, n) if (seet[i] == -1) {
						seet[i] = 0;
						break;
					}
				break;
					
				case 'B':
					for (int i = n - 1; i > 0; i--) if (seet[i] == -1) {
						if (seet[i - 1] == 0) i -= 2;
						else {
							seet[i] = 1;
							ok = true;
							break;
						}
					}
					if (ok) break;
					
					REP(i, n) if (seet[i] == -1) {
						seet[i] = 1;
						break;
					}
				break;
					
				case 'C':
					REP(i, n) if (seet[i] != -1) {
						if (i < n - 1 && seet[i + 1] == -1) {
							seet[i + 1] = 2;
							ok = true;
							break;
						}
						if (i > 0 && seet[i - 1] == -1) {
							seet[i - 1] = 2;
							ok = true;
							break;
						}
					}
					if (ok) break;
					seet[n / 2] = 2;
				break;
				
				case 'D':
					pii ma(-1, 0); // ?????¢, ??????
					
					int l = -1, r = 0;
					
					REP(i, n) {
						if (seet[i] == -1) {
							chmax(r, i + 1);
							while (r < n && seet[r] == -1) r++;
							
							int ls = l == -1 ? INF : i - l;
							int rs = r == n ? INF : r - i;
							
							chmax(ma, pii(min(ls, rs), -i));
						}
						else {
							l = i;
						}
					}
					
					if (ma.fi == INF) seet[0] = 3;
					else seet[-ma.se] = 3;
					
				break;
			}
			
		}
		REP(i, n) printf("%c", seet[i] == -1 ? '#' : seet[i] + 'A');
		puts("");
	}
	return 0;
}