#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

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

        string s(n, '#');
        for(int i=0; i<m; ++i){
            char c;
            cin >> c;
            if(c == 'A'){
                *find(s.begin(), s.end(), '#') = 'A';
            }else if(c == 'B'){
                bool ok = false;
                for(int j=n-1; j>=0; --j){
                    if(s[j] != '#')
                        continue;
                    if(j+1 < n && s[j+1] == 'A')
                        continue;
                    if(j-1 >= 0 && s[j-1] == 'A')
                        continue;
                    s[j] = 'B';
                    ok = true;
                    break;
                }
                if(!ok)
                    *find(s.begin(), s.end(), '#') = 'B';
            }else if(c == 'C'){
                if(i == 0){
                    s[n/2] = 'C';
                }else{
                    for(int j=0; j<n; ++j){
                        if(s[j] != '#'){
                            if(j+1 < n && s[j+1] == '#'){
                                s[j+1] = 'C';
                                break;
                            }else if(j-1 >= 0 && s[j-1] == '#'){
                                s[j-1] = 'C';
                                break;
                            }
                        }
                    }
                }
            }else{
                if(i == 0){
                    *find(s.begin(), s.end(), '#') = 'D';
                }else{
                    vector<int> dist(n, INT_MAX);
                    for(int j=0; j<n; ++j){
                        if(s[j] == '#')
                            continue;
                        int k = j;
                        do{
                            dist[k] = j - k;
                        }while(--k >= 0 && s[k] == '#');
                        k = j;
                        do{
                            dist[k] = k - j;
                        }while(++ k < n && s[k] == '#');
                    }
                    s[max_element(dist.begin(), dist.end()) - dist.begin()] = 'D';
                }
            }
        }

        cout << s << endl;
    }
}