#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
	int n, m;
	char str[10001];
	
	while (scanf("%d %d", &n, &m) && n){
		memset(str, '#', sizeof(str));
		vector<int> used;
		str[n] = 0;
		for (int i = 0; i < m; i++){
			char p;
			scanf(" %c", &p);
			
			if (p == 'A'){
				for (int pos = 0; pos < n; pos++){
					if (str[pos] == '#'){
						str[pos] = 'A';
						used.push_back(pos);
						break;
					}
				}
			}
			if (p == 'B'){
				bool seated = false;
				for (int pos = n - 1; pos; pos--){
					if (str[pos] == '#' && (pos == 0 || str[pos - 1] != 'A')){
						str[pos] = 'B';
						used.push_back(pos);
						seated = true; break;
					}
				}
				if (!seated)
					for (int pos = 0; pos < n; pos++){
					if (str[pos] == '#'){
						str[pos] = 'B'; used.push_back(pos);
						break;
					}
				}
			}
			if (p == 'C'){
				if (i == 0){
					if (n & 1){
						str[(n + 1) / 2 - 1] = 'C';
						used.push_back((n + 1) / 2 - 1);
					}
					else {
						str[n / 2] = 'C';
						used.push_back(n / 2);
					}
				}
				else {
					for (int pos = 0; pos < n; pos++){
						if (str[pos] != '#'){
							if (pos + 1 < n && str[pos + 1] == '#'){
								str[pos + 1] = 'C';
								used.push_back(pos + 1);
								break;
							}
							if (pos - 1 >= 0 && str[pos - 1] == '#'){
								str[pos - 1] = 'C';
								used.push_back(pos - 1);
								break;
							}
						}
					}
				}
			}
			if (p == 'D'){
				if (i == 0){
					str[0] = 'D';
					used.push_back(0);
				}
				else {
					sort(used.begin(), used.end());
					int minDist = 999999, minPos = -1;
					for (int pos = 0; pos < n; pos++){
						if (str[pos] == '#'){
							int a = upper_bound(used.begin(), used.end(), pos) - used.begin() - 1;
							int b = upper_bound(used.begin(), used.end(), pos) - used.begin();
							int tDist = 0;
							if (a != -1) tDist = max(tDist, pos - used[a]);
							if (b != used.size()) tDist = max(tDist, used[b] - pos);
							if (tDist < minDist){
								minDist = tDist;
								minPos = pos;
							}
						}
					}
					str[minPos] = 'D';
					used.push_back(minPos);
				}
			}
		}
		printf("%s\n", str);
	}
}