#include<iostream>
#include<algorithm>
using namespace std;

int main(){
  int n,m;

  for(;;){
    cin >> n >> m;
    if(!n && !m)break;

    string c;
    for(int i=0;i<n;i++)c += '#';

    for(int i=0;i<m;i++){
      char g;
      cin >> g;

      int pos;
      if(g == 'A'){
	pos = 0;
	while(c[pos]!='#')pos++;
      }else if(g == 'B'){
	pos = n-1;
	while(pos>=0){
	  if(c[pos]=='#'){
	    if( (pos==n-1 || c[pos+1]!='A') && (pos==0 || c[pos-1]!='A') )break;
	  }
	  pos--;
	}
	if(pos<0){
	  pos = 0;
	  while(c[pos]!='#')pos++;
	}
      }else if(g == 'C'){
	if(!i)pos = n/2;
	else{
	  pos = 0;
	  while(pos<n){
	    if(c[pos]!='#'){
	      if(pos<n-1 && c[pos+1]=='#'){
		pos++;
		break;
	      }
	      if(pos>0 && c[pos-1]=='#'){
		pos--;
	      break;
	      }
	    }
	    pos++;
	  }
	}
      }else{
	pos = 0;
	if(i){
	  int dis = 0;
	  int tmp = -1;
	  while(pos<n){
	    if(c[pos]=='#'){
	      int l = 1,r = 1;
	      while(pos-l>=0 && c[pos-l]=='#')l++;
	      while(pos+r<n && c[pos+r]=='#')r++;
	      if(pos-l<0){
		if(dis<r){
		  dis = r;
		  tmp = pos;
		}
	      }else if(pos+r>=n){
		if(dis<l){
		  dis = l;
		  tmp = pos;
		}
	      }else{
		if(dis<min(l,r)){
		  dis = min(l,r);
		  tmp = pos;
		}
	      }
	    }
	    pos++;
	  }
	  pos = tmp;
	}
      }
      c[pos] = g;
    }

    cout << c << endl;
  }
}