#include<bits/stdc++.h>
using namespace std;
typedef long long int lld;

int main(){
  int n,m;
  while(cin >> n >> m , n){
    string str = "";
    for(int i=0;i<n;i++) str += '#';
    for(int c=0;c<m;c++){
      char h; cin >> h;
      if(h == 'A'){
	for(int i=0;i<n;i++){
	  if(str[i] == '#'){
	    str[i] = h;
	    break;
	  }
	}
      } else if(h == 'B'){
	int first = -1;
	bool flg = true;
	for(int i=n-1;i>=0;i--){
	  if(first == -1 && str[i] == '#') first = i;
	  /*
	  if(i == n-1 && str[i] == '#' && str[i-1] != 'A'){
	    str[i] = h;
	    flg = false;
	    break;
	  } else if(i == 0 && str[i] == '#' && str[i+1] != 'A'){
	    str[i] = h;
	    flg = false;
	    break;*/
	  if(str[i] == '#' && str[i-1] != 'A' && str[i+1] != 'A'){
	    str[i] = h;
	    flg = false;
	    break;
	  }
	  if(flg) str[first] = h;
	}
      } else if(h == 'C'){
	if(c == 0) str[(n%2==1 ? (n+1)/2 : (n/2+1)) -1] = 'C';
	else {
	  for(int i=0;i<n;i++){
	    if(str[i] != '#'){
	      if(str[i+1] == '#') {
		str[i+1] = h;
		break;
	      }
	      if(str[i-1] == '#') {
		str[i-1] = h;
		break;
	      }
	    }
	  }
	}
      } else {
	int first = -1;
	int idx = -1;
	int maxx = 0;
	for(int i=0;i<n;i++){
	  if(first == -1 && str[i] == '#') first = i;
	  if(str[i] != '#'){
	    int now = i;
	    int cnt = 0;
	    while(i+1 < n && str[i+1] == '#'){
	      if(first == -1 && str[i+1] == '#') first = i+1;
	      cnt++;
	      i++;
	    }
	    if(i+1 == n) {
	      if(cnt > maxx){
		maxx = cnt;
		idx = now + cnt;
	      }
	    }
	    else if(cnt > 2){
	      cnt = (cnt-1)/2;
	      if(cnt > maxx){
		maxx = cnt;
		idx = now + cnt + 1;
	      }
	    }
	  }
	}
	if(idx == -1) str[first] = h;
	else str[idx] = h;
      }
    }
    cout << str << endl;
  }
}