#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

void PersonA(string&);
void PersonB(string&);
void PersonC(string&);
void PersonD(string&);
bool UsingSeat(const char&);

int main(){
  int i, n, m;
  string c;

  while(1){
    cin >> n >> m;
    if(n == 0 && m == 0) break;
    string chair(n, '#');

    for(i=0; i<m; ++i){
      cin >> c;
      if(c == "A") PersonA(chair);
      else if(c == "B") PersonB(chair);
      else if(c == "C") PersonC(chair);
      else if(c == "D") PersonD(chair);
    }
    cout << chair << endl;
  }
  return 0;
}

void PersonA(string& s){
  string::iterator i;
  i = find(s.begin(), s.end(), '#');
  *i = 'A';
}

void PersonB(string& s){
  string::reverse_iterator i, j;
  string::iterator k;
  for(j=s.rbegin(); i!=s.rend(); j=i+1){
    i = find(j, s.rend(), '#');
    if((i == s.rbegin() && *(i+1) != 'A') ||
       (i == s.rend()-1 && *(i-1) != 'A') ||
       (*(i-1) != 'A' && *(i+1) != 'A')){
      *i = 'B';
      return;
    }
  }
  k = find(s.begin(), s.end(), '#');
  *k = 'B';
}

void PersonC(string& s){
  string::iterator i;
  i = find_if(s.begin(), s.end(), UsingSeat);
  if(i == s.end()){
    s[s.size()/2] = 'C';
    return;
  }
  while(i != s.end()){
    if(*i == '#'){
      *i = 'C';
      return;
    }
    ++i;
  }
}

void PersonD(string& s){
  string::iterator i, j, k;
  i = find_if(s.begin(), s.end(), UsingSeat);
  if(i == s.end()){
    s[0] = 'D';
    return;
  }
  int empty, _empty;
  empty = i - s.begin();
  k = s.begin();
  ++i;
  while(1){
    j = find_if(i, s.end(), UsingSeat);
    if(j == s.end()) break;
    _empty = j - i;
    if(_empty%2 == 0 && _empty/2 > empty){
      empty = _empty/2;
      k = i + empty - 1;
    }
    else if(_empty%2 == 1 && _empty/2 + 1 > empty){
      empty = _empty/2 + 1;
      k = i + empty - 1;
    }
    i = j + 1;
  }
  _empty = s.end() - i;
  if(_empty > empty) k = s.end()-1;
  *k = 'D';
}

bool UsingSeat(const char& c){
  if(c == '#') return false;
  else return true;
}