#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int n, m;
	while (cin >> m >> n&&n != 0 && m != 0) {
		char a[100];
		fill(a, a + m, '#');
		for (int z = 0; z < n; z++) {
			char b;
			cin >> b;
			switch (b) {
				case 'A':
					for (int i = 0; i < m; i++) {
						if (a[i] == '#') {
							a[i] = 'A';
							break;
						}
					}
					break;
				case 'B': 
					for (int i = m - 1; i >= 0; i--) {
						if ((i == (m - 1) && a[m - 2] != 'A'&&a[i] == '#') || (i == 0 && a[1] != 'A'&&a[i] == '#') || (a[i - 1] != 'A'&&a[i] == '#'&&a[i + 1] != 'A')) {
							a[i] = 'B';
							goto stop;
						}
					}
					for (int i = 0; i < m; i++) {
						if (a[i] == '#') {
							a[i] = 'B';
							break;
						}
					}
				stop:;
					break;
				case 'C':
					if (z == 0) {
						if (m % 2 == 1)
							a[(m + 1) / 2-1] = 'C';
						else
							a[m / 2] = 'C';
						goto st;
					}
					for (int i = 1; i < m; i++) {
						if (a[i - 1] != '#'&&a[i] == '#') {
							a[i] = 'C';
							goto st;
						}
					}
				st:;
					break;
				case 'D':
					int f = 0, g = 0, o = 0, p = 0;
					if (z == 0) {
						a[0] = 'D'; goto stp;
					}
					for (int i = m - 1; i >= 0; i--) {
						int h = 0, k = 10000;
						for (int j = i; j >= 0; j--) {
							if (a[j] != '#')
								break;
							else {
								o++;
								h++;
							}
						}
						for (int j = i; j < m; j++) {
							if (a[j] != '#')
								break;
							else {
								if (j +1!= m) k = 0;
								p++;
								k++;
							}
						}
						if (g <= min(h, k)) {
							f = i;
							g = min(h, k);
						}
					}
					a[f] = 'D';
				stp:;
					break;
			}
		}
		for (int i = 0; i < m; i++) {
			cout << a[i];
		}
		cout << endl;
	}
}