#include <bits/stdc++.h>
using namespace std;

int main(){
    while(1){
        int n, m; cin>>n>>m;
        if(n == 0) return 0;

        string s = "";
        for(int i=0; i<n; i++){
            s += "#";
        }

        while(m--){
            char a; cin>>a;
            if(a == 'A'){
                for(int i=0; i<n; i++){
                    if(s[i] == '#'){
                        s[i] = 'A';
                        break;
                    }
                }
            }
            else if(a == 'B'){
                bool valid = false;
                for(int i=n-1; i>=0; i--){
                    if(s[i] != '#') continue;

                    if((i + 1 < n && s[i+1] == 'A') || (0 <= i - 1 && s[i-1] == 'A')) continue;
                
                    s[i] = 'B';
                    valid = true;
                    break;
                }

                if(valid) continue;

                for(int i=0; i<n; i++){
                    if(s[i] == '#'){
                        s[i] = 'B';
                        break;
                    }
                }
            }
            else if(a == 'C'){
                bool valid = false;
                for(int i=0; i<n; i++){
                    if(s[i] != '#'){
                        if(i + 1 < n && s[i+1] == '#'){
                            s[i+1] = 'C';
                            valid = true;
                            break;
                        }
                        
                        if(0 <= i - 1 && s[i-1] == '#'){
                            s[i-1] = 'C';
                            valid = true;
                            break;
                        }
                    }
                }

                if(valid) continue;

                s[n/2] = 'C';
            }
            else{
                int dist = 0;
                int id = -1;
                for(int i=0; i<n; i++){
                    if(s[i] != '#') continue;
                    int near = 1e9;
                    for(int j=0; j<n; j++){
                        if(i == j || s[j] == '#') continue;
                        
                        near = min(near, abs(i - j));
                    }

                    if(near == 1e9) continue;

                    if(dist < near){
                        dist = near;
                        id = i;
                    }
                }

                if(id != -1){
                    s[id] = 'D';
                }
                else{
                    s[0] = 'D';
                }
            }
        }

        cout << s << endl;
    }
}
