#include<iostream>
#include<string.h>
#include<cstdio>
using namespace std;
int main() {
	int n, m, temp;
	char str, str2[10001], str3[10001] = { NULL };
	while (1) {
		cin >> n >> m;
		if (n == 0 && m == 0)return 0;
		for (int i = 0; i < m; i++) {
			cin >> str2[i];
		}
		for (int i = 0; i < n; i++) {
			str3[i] = '#';
		}
		for (int i = 0; i < m; i++) {
			if (str2[i] == 'A') {
				for (int j = 0; j < n; j++) {
					if (str3[j] == '#') {
						str3[j] = 'A';
						goto end;
					}
				}
			}
			else if (str2[i] == 'B') {
				for (int j = n - 1; j > 0; j--) {
					if (str3[j] == '#'&&str3[j - 1] != 'A'&&str3[j + 1] != 'A') {
						str3[j] = 'B';
						temp++;
						goto end;
					}
				}
				if (temp == 0) {
					for (int j = 0; j < n; j++) {
						if (str3[j] == '#') {
							str3[j] = 'B';
							temp++;
							goto end;
						}
					}
				}
				/*if (temp == 0) {
					for (int j = 0; j < n; j++) {
						if (str3[j] == '#') {
							str3[j] = 'B';
							goto end;
						}
					}
				}*/
				temp = 0;
			}
			else if (str2[i] == 'C') {
				for (int j = 0; j < n; j++) {
					if (str3[j] != '#') {
						if (str3[j + 1] == '#') {
							str3[j + 1] = 'C';
							temp++;
							goto end;
						}
					}
				}
				if (temp == 0) {
					if (n % 2 == 0)temp = n / 2 + 1;
					else temp = (n + 1) / 2;
					str3[temp] = 'C';
				}
				temp = 0;
			}
			else if (str2[i] == 'D') {
				int q,p,d;
				int D[100];
				d = n * 2;
				for ( p = -1; ++p < n;) {
					d++;
					if (str3[p] != '#')
						d = 0;
					D[p] = d;
				}
				for ( d = n; --p >= 0;) {
					d++;
					if (str3[p] != '#')
						d = 0;
					if (d < D[p])
						D[p] = d;
				}
				for ( p = q = 0; q < n; q++)
					if (D[q] > D[p])
						p = q;
				str3[p] = 'D';
				goto end;
			}
			/*for (int i = 0; i < n; i++) {
				cout << str3[i];
			}
			cout << endl;*/
		end:;
		}
		for (int i = 0; i < n; i++) {
			cout << str3[i];
		}
		cout << endl;
		memset(str3, NULL, sizeof(str3));
		memset(str2, NULL, sizeof(str2));
		temp = 0;
	}
}