#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define BLANK '#'
int main()
{
  int n,m;
  int i,j,blank,maximum,d1,d2;
  bool f;
  char c;
  vector<char> seat;
  while(cin>>n>>m,n|m){
    seat.resize(n);
    for(i=0;i<n;i++)seat[i]=BLANK;
    while(m-->0){
      cin>>c;
      switch(c){
	// A
	case 'A':
	  for(i=0;i<n;i++)
	    if(seat[i]==BLANK){seat[i]=c;break;}
	  break;
	// B
	case 'B':
	  for(i=n;i-->0;){
	    if(seat[i]==BLANK){
	      f=true;
	      if(i+1<n&&seat[i+1]=='A')f=false;
	      if(i>0&&seat[i-1]=='A')f=false;
	      blank=i;
	      if(f){seat[blank]=c;break;}
	    }
	  }
	  if(seat[blank]==BLANK)seat[blank]=c;
	  break;
	// C
	case 'C':
	  f=true;
	  for(i=0;i<n;i++)if(seat[i]!=BLANK)f=false;
	  if(f){seat[n/2]=c;break;}
	  for(i=0;i<n;i++){
	    if(seat[i]!=BLANK){
	      if(i+1<n&&seat[i+1]==BLANK){seat[i+1]=c;break;}
	      if(i>0&&seat[i-1]==BLANK){seat[i-1]=c;break;}
	    }
	  }
	  break;
	// D
	case 'D':
	  maximum=-1;
	  blank=0;
	  for(i=0;i<n;i++){
	    if(seat[i]==BLANK){
	      f=false;
	      for(d1=0,j=i;j-->0;d1++)if(seat[j]!=BLANK){f=true;break;}
	      if(!f)d1=n;
	      f=false;
	      for(d2=0,j=i;++j<n;d2++)if(seat[j]!=BLANK){f=true;break;}
	      if(!f)d2=n;
	      if(maximum<min(d1,d2)){maximum=min(d1,d2);blank=i;}
	    }
	  }
	  seat[blank]=c;
	  break;
      }
    }
    for(i=0;i<n;i++)cout<<seat[i];
    cout<<endl;
  }
}