#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
void A(vector<char>&);
void B(vector<char>&);
void C(vector<char>&);
void D(vector<char>&);
char get(vector<char>&, bool, int);
int main() {
	int n, m;
	while (cin >> n >> m&&n != 0) {
		vector<char> line(n + 1, '#');
		for (int i = 0; i < m; ++i) {
			char num;
			cin >> num;
			if (num == 'A') {
				A(line);
			}
			else if (num == 'B') {
				B(line);
			}
			else if (num == 'C') {
				C(line);
			}else{
				D(line);
			}
		}
		for (int i = 1; i < line.size(); ++i) {
			cout << line[i];
		}
		cout << endl;
	}
	return 0;
}

char get(vector<char>&line, bool right, int place) {
	if (right) {
		if (place == line.size() - 1)return '#';
		else return line[place + 1];
	}
	else {
		return line[place - 1];
	}
}

void A(vector<char> &line) {
	for (int i = 1; i < line.size(); ++i) {
		if (line[i] == '#') {
			line[i] = 'A';
			break;
		}
	}
}

void B(vector<char> &line) {
	for (int i = line.size() - 1; i > 0; --i) {
		if (line[i] == '#'&&get(line, true, i) != 'A' && get(line, false, i) != 'A') {
			line[i] = 'B';
			return;
		}
	}
	for (int i = 1; i < line.size(); ++i) {
		if (line[i] == '#') {
			line[i] = 'B';
			return;
		}
	}
}

void C(vector<char> &line) {
	for (int i = 1; i < line.size(); ++i) {
		if (line[i] != '#') {
			if (i != line.size() - 1 && line[i + 1] == '#') {
				line[i + 1] = 'C';
				return;
			}
			else if (i != 1 && line[i - 1] == '#') {
				line[i - 1] = 'C';
				return;
			}
		}
	}
	if (line.size() % 2 == 0) {
		line[line.size() / 2] = 'C';
		return;
	}
	else {
		line[line.size() / 2 + 1] = 'C';
	}
}

void D(vector<char> &line) {
	vector<int> dline(line.size());
	int num = line.size() + 1;
	bool flag = false;
	for (int i = 1; i < line.size(); ++i) {
		++num;
		if (line[i] != '#') {
			num = 0;
			flag = true;
		}
		dline[i] = num;
	}
	if (!flag) {
		line[1] = 'D';
		return;
	}
	num = line.size() + 1;
	for (int i = line.size() - 1; i > 0; --i) {
		++num;
		if (line[i] != '#') {
			num = 0;
		}
		dline[i] = min(dline[i], num);
	}
	int mn = 0, mp = 0;
	for (int i = 1; i < line.size(); ++i) {
		if (mn < dline[i]) {
			mn = dline[i];
			mp = i;
		}
	}
	line[mp] = 'D';
}