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

using namespace std;

void PersonA(string&);
void PersonB(string&);
void PersonC(string&);
void PersonD(string&);
int SeatCheck(int, string);
bool NotEmptySeat(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 iter;

  iter = find(s.begin(), s.end(), '#');
  *iter = 'A';
}

void PersonB(string& s){
  int i, isFound = 0;
  string::iterator iter;

  if(s[s.size()-1] == '#' && s[s.size()-1] != 'A'){
    s[s.size()-1] = 'B';
    isFound = 1;
  }else{
    for(i=s.size()-2; i>0; --i){
      if(s[i] == '#' && s[i-1] != 'A' && s[i+1] != 'A'){
	s[i] = 'B';
	isFound = 1;
	break;
      }
    }
    if(isFound == 0){
      if(s[0] == '#' && s[1] != 'A'){
	s[0] = 'B';
	isFound = 1;
      }
    }
  }

  if(isFound == 0){
    iter = find(s.begin(), s.end(), '#');
    *iter = 'B';
  }
}

void PersonC(string& s){
  string::iterator iter1, iter2;

  iter1 = find_if(s.begin(), s.end(), NotEmptySeat);
  if(iter1 == s.end()){
    if(s.size()%2 == 1) s[(s.size()-1)/2] = 'C';
    else s[s.size()/2] = 'C';
  }else{
    iter2 = find(iter1 +1, s.end(), '#');
    if(iter2 == s.end()) *(iter1 -1) = 'C';
    else *iter2 = 'C';
  }
}

void PersonD(string& s){
  int i, n, count=0, _count, countleft, countright;
  string::iterator iter;

  iter = find_if(s.begin(), s.end(), NotEmptySeat);
  if(iter == s.end()){
    s[0] = 'D';
  }else{
    for(i=0; i<s.size(); ++i){
      if(s[i] == '#'){
	_count = SeatCheck(i, s);
	if(_count > count){
	  n = i;
	  count = _count;
	}
      }
    }

    if(count == 0){
      iter = find(s.begin(), s.end(), '#');
      *iter = 'D';
    }else{
      s[n] = 'D';
    }
  }
}

int SeatCheck(int n, string s){
  int i, count1, count2, isFound1=0, isFound2=0;

  for(i=n-1, count1=0; i>=0; --i, ++count1){
    if(s[i] != '#'){
      isFound1 = 1;
      break;
    }
  }
  for(i=n+1, count2=0; i<s.size(); ++i, ++count2){
    if(s[i] != '#'){
      isFound2 = 1;
      break;
    }
  }

  if(isFound1 == 0){
    return count2;
  }else if(isFound2 == 0){
    return count1;
  }else{
    if(count1 < count2) return count1;
    else return count2;
  }
}

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