#include <iostream>
#include <vector>
#include <queue>
#include <cmath>

using namespace std;

typedef pair<int, int> P;

int main() {
	int n, m;
	while (cin >> n >> m) {
		if (n == 0 && m == 0) {
			break;
		}
		vector<char> isu(n, '#');
		char c;
		for (int i = 0; i < m; i++) {
			cin >> c;
			if (c == 'A') {
				for (int j = 0; j < n; j++) {
					if (isu[j] == '#') {
						isu[j] = 'A';
						break;
					}
				}
			} else if (c == 'B') {
				bool hantei = true;
				for (int j = n-1; j >= 0; j--) {
					if (isu[j] == '#') {
						if (j != 0 && j != n-1) {
							if (isu[j-1] != 'A' && isu[j+1] != 'A') {
								isu[j] = 'B';
								hantei = false;
								break;
							}
						} else if (j == 0) {
							if (isu[j+1] != 'A') {
								isu[j] = 'B';
								hantei = false;
								break;
							}
						} else {
							if (isu[j-1] != 'A') {
								isu[j] = 'B';
								hantei = false;
								break;
							}
						}
					}
				}
				if (hantei) {
					for (int j = 0; j < n; j++) {
						if (isu[j] =='#') {
							isu[j] = 'B';
							break;
						}
					}
				}
			} else if (c == 'C') {
				bool hantei = true;
				for (int j = 0; j < n; j++) {
					if (isu[j] != '#') {
						if (j != n-1 && isu[j+1] == '#') {
							isu[j+1] = 'C';
							hantei = false;
							break;
						} else if (j != 0 && isu[j-1] == '#') {
							isu[j-1] = 'C';
							hantei = false;
							break;
						}
					}
				}
				if (hantei) {
					isu[n/2] = 'C';
				}
			} else {
				queue<P> q;
				for (int j = 0; j < n; j++) {
					if (isu[j] == '#') {
						int counter = 1000;
						int counter2 = 1000;
						int d;
						for (int k = j-1; k >= 0; k--) {
							if (isu[k] != '#') {
								counter = j-k;
								break;
							}
						}
						for (int k = j+1; k < n; k++) {
							if (isu[k] != '#') {
								counter2 = k-j;
								break;
							}
						}
						d = min(counter, counter2);
						if (d == 1000) {
							break;
						}
						if (q.empty()) {
							P p;
							p.first = d;
							p.second = j;
							q.push(p);
						} else if ((q.front()).first < d) {
							while (!q.empty()) {
								q.pop();
							}
							P p;
							p.first = d;
							p.second = j;
							q.push(p);
						} else if ((q.front()).first == d) {
							P p;
							p.first = d;
							p.second = j;
							q.push(p);
						}
					}
				}
				if (q.empty()) {
					for (int j = 0; j < n; j++) {
						if (isu[j] == '#') {
							isu[j] = 'D';
							break;
						}
					}
				} else {
					P p = q.front();
					q.pop();
					isu[p.second] = 'D';
				}
			}
		}
		for (int i = 0; i < n; i++) {
			cout << isu[i];
		}
		cout << endl;
	}
	return 0; 
}