#include<bits/stdc++.h>
#define for1(i, n) for(int i = 1; i <= (n);i++)
using namespace std;
int n, m;
signed main() {
	while (cin >> n >> m, n) {
		string ans; for1(i, n + 2)ans += '#';
		for1(v1lah, m) {
			char ch; cin >> ch;
			if (ch == 'A') {
				for1(i, n)if (ans[i] == '#') { ans[i] = ch; break; }
			}
			else if (ch == 'B') {
				for (int i = n; i > 0; i--)if (ans[i] == '#' && ans[i - 1] != 'A' && ans[i + 1] != 'A') { ans[i] = ch; goto heavenb; }
				for1(i, n)if (ans[i] == '#') { ans[i] = ch; break; }
			heavenb:;
			}
			else if (ch == 'C') {
				if (v1lah == 1)ans[n / 2 + 1] = ch;
				else for1(i, n)if (ans[i] != '#') { if (i != n && ans[i + 1] == '#') { ans[i + 1] = ch; break; }if (i != 1 && ans[i - 1] == '#') { ans[i - 1] = ch; break; } }
			}
			else {
				if (v1lah == 1)ans[1] = ch;
				else {
					int a[110]; a[0] = n + 1;
					for1(i, n) {
						if (ans[i] == '#')a[i] = a[i - 1] + 1;
						else {
							a[i] = 0; int p = i - 1;
							while (p >= 1) { if (a[p] > a[p + 1] + 1)a[p] = a[p + 1] + 1; else break; p--; }
						}
					}
					int p = 1;
					for1(i, n)if (a[p] < a[i])p = i;
					ans[p] = ch;
				}
			}
		}
		cout << ans.substr(1, n) << endl;
	}
}
