#include <iostream>
#include <vector>
#include <algorithm>

int main() {
	int n, m;
	const char output[] = { '#', 'A', 'B', 'C', 'D' };
	std::vector<int> seat;
	
	while (std::cin >> n >> m) {
		if (n == 0 && m == 0)
			break;

		seat.resize(n);

		for (int i = 0; i < m; ++i) {
			char who;
			std::cin >> who;

			if (who == 'A') {
				for (int j = 0; j < n; ++j) {
					if (seat[j] == 0) {
						seat[j] = 1;
						break;
					}
				}
			}
			else if (who == 'B') {
				int firstEmpty = 334;
				bool isRightA = false;

				for (int j = n - 1; j >= 0; --j) {
					if (seat[j] == 0) {
						firstEmpty = std::min(firstEmpty, j);
						if (!isRightA && (j == 0 || seat[j - 1] != 1)) {
							seat[j] = 2;
							break;
						}
					}
					isRightA = seat[j] == 1;
				}
			}
			else if (who == 'C') {
				for (int j = 0; j < n; ++j) {
					if (j != 0) {
						if (j != n - 1 && seat[j + 1] == 0) {
							seat[j + 1] = 2;
							break;
						}
						if (j != 0 && seat[j - 1] == 0) {
							seat[j - 1] = 2;
							break;
						}
					}
					if (j == n - 1)
						seat[n / 2] = 2;
				}
			}
			else if (who == 'D') {
				int maxDist = 334;
				int maxIdx = 0;

				int dist = 0;

				int fromTop = 0;
				int toLast = 0;

				for (int j = 0; j < n; ++j) {
					++dist;
					if (j == n - 1)
						toLast = dist;

					if (seat[j] != 0) {
						if (fromTop == 0)
							fromTop = j + 1;

						if (maxDist < dist / 2) {
							maxDist = dist / 2;
							maxIdx = j - dist;
						}
						dist = 0;
					}
				}

				if (seat[n - 1] == 0 && toLast > maxDist && fromTop < toLast)
					seat[n - 1] = 3;
				else if (seat[0] == 0 && fromTop > maxDist && fromTop > toLast)
					seat[0] = 3;
				else
					seat[maxIdx + maxDist] = 3;
			}
		}

		for (int i = 0; i < m; ++i)
			std::cout << output[i];
		std::cout << std::endl;
	}

	return 0;
}