#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>

using namespace std;
#define int long long int
const int INF = 1001001001001001LL;
const int MOD = 1000000007;

int di[] = {-1, 0, 1, 0, -1, 1, 1, -1};
int dj[] = {0, 1, 0, -1, 1, 1, -1, -1};


void f(string &s, char op){
    
    int n = s.size();
    if(op == 'A'){
        for(int i = 0; i < n; i++){
            if(s[i] == '#'){
                s[i] = 'A';
                return;
            }
        }
        
    }

    if(op == 'B'){
        for(int i = n - 1; i >= 0; i--){
            if(s[i] != '#') continue;

            if(i == n - 1){
                if(s[i - 1] != 'A'){
                    s[i] = 'B';
                    return;
                }
            }else if(i == 0){
                if(s[i + 1] != 'A'){
                    s[i] = 'B';
                    return;
                }
            }else{
                if(s[i - 1] != 'A' && s[i + 1] != 'A'){
                    s[i] = 'B';
                    return;
                }
            }
        }

        for(int i = 0; i < n; i++){
            if(s[i] == '#'){
                s[i] = 'B';
                return;
            }
        }
    }

    if(op == 'C'){
        
        bool check = false;
        for(int i = 0; i < n; i++){
            if(s[i] != '#') check = true;
        }

        if(check){
            for(int i = 0; i < n; i++){
                if(s[i] != '#'){
                    if(i != n - 1 && s[i + 1] == '#'){
                        s[i + 1] = 'C';
                        return;
                    }else if(i != 0 && s[i - 1] == '#'){
                        s[i - 1] = 'C';
                        return;
                    }
                }
            }
        }else{
            int idx = n / 2;
            s[idx] = 'C';
            return;
        }
    }

    if(op == 'D'){
        vector<int> v(n, INF);
        for(int i = 0; i < n; i++) if(s[i] != '#') v[i] = 0;
        for(int i = 0; i < n; i++){
            if(s[i] != '#'){
                int dis = 0;
                for(int j = i + 1; j < n; j++){
                    dis++;
                    if(s[j] != '#') continue;
                    v[j] = min(v[j], dis);
                }

                dis = 0;
                for(int j = i - 1; j >= 0; j--){
                    dis++;
                    if(s[j] != '#') continue;
                    v[j] = min(v[j], dis);
                }
            }
        }

        /*
        for(int i = 0; i < n; i++) cout << v[i] << " ";
        cout << endl;
        */

        int ans = 0;
        int idx = 0;
        for(int i = 0; i < n; i++){
            if(s[i] != '#') continue;
            if(ans < v[i]){
                ans = v[i];
                idx = i;
            }
        }

        s[idx] = 'D';

        return;
    }

}

signed main(){
    
    while(1){
        int n, q; cin >> n >> q;
        if(n == 0 && q == 0) break;
        
        string seet;
        for(int i = 0; i < n; i++) seet = seet + "#";
        
        for(int i = 0; i < q; i++){
            char op; cin >> op;
            f(seet, op);
        }

        cout << seet << endl;
        
    }
    return 0;
}

