#define _USE_MATH_DEFINES
#include <iostream>
#include <complex>
#include <algorithm>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <cmath>
#include <math.h>
#include <numeric>
#include <list>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <set>
#include <memory.h>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cassert>
#include <map>
#include <cassert>
#include <time.h>
#include <ctime>

using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int , P> PP;
typedef pair<int, string> Ps;
typedef vector<int> vec;
typedef vector<vec> mat;
const int INF = 1 << 27;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;
const int CLK = CLOCKS_PER_SEC;

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)

int main(){
	int n, m;
	while(cin>> n >> m && (n || m)){
		string chair(n, '#');
		char ch;
		rep(i, m){
			cin >> ch;
			if(ch == 'A'){
				rep(j, n){
					if(chair[j] == '#'){
						chair[j] = ch;
						break;
					}
				}
			}else if(ch == 'B'){
				bool ok = false;
				rep(j, n){
					if(chair[n-j-1] == '#' && 
						(j == 0 || chair[n-j] != 'A' 
						&& j == n - 1 || chair[n-j-2] != 'A')){
						chair[n-j-1] = ch;
						ok = true;
						break;
					}
				}
				if(!ok){
					rep(j, n){
						if(chair[j] == '#'){
							chair[j] = ch;
							break;
						}
					}
				}
			}else if(ch == 'C'){
				if(i == 0){
					chair[n/2] = ch;
				}else{
					rep(j, n){
						if(chair[j] != '#'){
							if(chair[j+1] == '#'){
								chair[j+1] = ch;
								break;
							}else if(j > 0 && chair[j-1] == '#'){
								chair[j-1] = ch;
								break;
							}
						}
					}
				}
			}else{
				if(i == 0){
					chair[0] = ch;
				}else{
					int best = 0;
					int dis = 0;
					rep(i, n){
						if(chair[i] != '#') continue;
						int d = INF;
						rep(j, n){
							if(chair[j] != '#'){
								d = min(abs(j - i), d);
							}
						}
						if(d > dis){
							dis = d;
							best = i;
						}
					}
					chair[best] = ch;
				}
			}
		}
		cout << chair << endl;
	}
	return 0;
}