#include<iostream>
#include<string>
using namespace std;
int main(){
  int n,m;
  while(cin >>n>>m,n||m){
    int row[100] = {0},chair[102] = {0};
    for(int i=0; i<m; i++){
      string s;
      cin >>s;
      if(s == "A"){row[i] = 1;}
      if(s == "B"){row[i] = 2;}
      if(s == "C"){row[i] = 3;}
      if(s == "D"){row[i] = 4;}
    }
    for(int i=0; i<m; i++){
      if(row[i] == 1){
	for(int j=0; j<n; j++){
	  if(!chair[j+1]){
	    chair[j+1] = 1;
	    break;
	  }
	}
      }
      if(row[i] == 2){
	bool non = true;
	for(int j=n-1; j>=0; j--){
	  if(chair[j] != 1 && chair[j+1] == 0 && chair[j+2] != 1){
	    chair[j+1] = 2;
	    non = false;
	    break;
	  }
	}
	if(non){
	  for(int j=0; j<n; j++){
	    if(!chair[j+1]){
	      chair[j+1] = 2;
	      break;
	    }
	  }
	}
      }
      if(row[i] == 3){
	if(!i){
	  if(n%2){chair[(n+1)/2] = 3;}
	  else{chair[n/2+1] = 3;}
	}
	else{
	  for(int j=1; j<=n; j++){
	    if(chair[j] && !chair[j+1] && j < n-1){
	      chair[j+1] = 3;
	      break;
	    }
	    if(chair[j] && !chair[j-1] && j > 1){
	      chair[j-1] = 3;
	      break;
	    }
	  }
	}
      }
      if(row[i] == 4){
	if(!i){chair[1] = 4;}
	else{
	  int r = 0,s = -1;
	  bool non = true;
	  for(int j=0; j<n; j++){
	    if(!chair[j+1]){
	      int x = 200;
	      for(int k=j+1; k<n; k++){
		if(chair[k+1]){
		  if(x > k-j){x = k-j;}
		  break;
		}
	      }
	      for(int k=j-1; k>=0; k--){
		if(chair[k+1]){
		  if(x > j-k){x = j-k;}
		  break;
		}
	      }
	      if(r < x){r = x;s = j;}
	    }
	  }
	  if(s != -1){
	    chair[s+1] = 4;
	    non = false;
	  }
	  if(non){
	    for(int j=0; j<n; j++){
	      if(!chair[j+1]){
		chair[j+1] = 4;
		break;
	      }
	    }
	  }
	}
      }
    }
    for(int i=0; i<n; i++){
      if(chair[i+1] == 0){cout <<"#";}
      if(chair[i+1] == 1){cout <<"A";}
      if(chair[i+1] == 2){cout <<"B";}
      if(chair[i+1] == 3){cout <<"C";}
      if(chair[i+1] == 4){cout <<"D";}
    }
    cout <<endl;
  }
  return 0;
}