#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
int n, q; char c; bool flag, flag1, flag2;
int main() {
	while (cin >> n >> q, n) {
		string s(n, '#');
		for(int l = 0; l < q; l++) {
			cin >> c;
			switch (c) {
			case 'A':
				for (int i = 0; i < n; i++) {
					if (s[i] == '#') {
						s[i] = 'A'; break;
					}
				}
				break;
			case 'B':
				flag = false;
				for (int i = n - 1; i >= 0; i--) {
					if (s[i] != '#') continue;
					flag2 = true;
					for (int j = -1; j <= 1; j += 2) {
						if (0 <= i + j && i + j < n && s[i + j] == 'A') flag2 = false;
					}
					if (flag2) {
						s[i] = 'B'; flag = true; break;
					}
				}
				if (!flag) {
					for (int i = 0; i < n; i++) {
						if (s[i] == '#') {
							s[i] = 'B'; break;
						}
					}
				}
				break;
			case 'C':
				flag1 = false;	
				if (l == 0) {
					s[n / 2] = false; break;
				}
				for (int i = 0; i < n; i++) {
					for (int j = 1; j >= -1; j -= 2) {
						if (0 <= i + j && i + j < n && s[i + j] == '#') {
							s[i + j] = 'C'; flag1 = true; break;
						}
					}
					if (flag1) break;
				}
				break;
			case 'D':
				int ptr = -1, ret = -1;
				for (int i = 0; i < n; i++) {
					int res = 999999999;
					for (int j = 0; j < n; j++) {
						if (s[j] != '#') res = min(res, abs(i - j));
					}
					if (ret < res) ptr = i, ret = res;
				}
				s[ptr] = 'D';
				break;
			}
		}
		cout << s << endl;
	}
}