#include <iostream>
#include <string>
#include <vector>
#include <climits>
using namespace std;

int n, m;
string seat;

void sit(char a) {
    switch (a) {
        case 'A': {
            for (int i=1; i<=n; ++i) {
                if (seat[i] == '#') {
                    seat[i] = 'A'; return ;
                }
            }
            break;
        }
        case 'B': {
            for (int i=n; i>=1; --i) {
                if (seat[i] == '#' && seat[i-1] != 'A' && seat[i+1] != 'A') {
                    seat[i] = 'B'; return ;
                }
            }
            for (int i=1; i<=n; ++i) {
                if (seat[i] == '#') {
                    seat[i] = 'B'; return ;
                }
            }
            break;
        }
        case 'C': {
            bool empty = true;
            for (int i=1; i<=n; ++i) {
                if (seat[i] != '#') {
                    empty = false; break;
                }
            }
            if (empty) {
                seat[(n+2)/2] = 'C'; return ;
            }
            for (int i=1; i<=n; ++i) {
                if (seat[i] != '#') {
                    if (seat[i+1] == '#') {
                        seat[i+1] = 'C'; return ;
                    } else if (seat[i-1] == '#') {
                        seat[i-1] = 'C'; return ;
                    }
                }
            }
            break;
        }
        case 'D': {
            int k, mx = -1;
            for (int i=1; i<=n; ++i) {
                int l = 0;
                while (0 < i-l && seat[i-l] == '#') ++l;
                int r = 0;
                while (i+r < n+1 && seat[i+r] == '#') ++r;

                if (i+r == n+1) r = INT_MAX;
                if (i-l == 0) l = INT_MAX;
                int dist = min(l, r);

                if (mx < dist) {
                    k = i;
                    mx = dist;
                }
            }
            seat[k] = 'D';
            break;
        }
    }
}

int main() {
    while (cin >> n >> m, (n || m)) {
        seat = "_";
        for (int i=0; i<n; ++i) {
            seat += "#";
        }
        seat += "_";
        char a;
        for (int i=0; i<m; ++i) {
            cin >> a;
            sit(a);
        }
        cout << seat.substr(1,n) << endl;
    }
    return 0;
}