#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
const int INF = 1 << 28;

int N, M;
void a_sit(string &s) {
  for(int i=0; i<N; i++) {
    if(s[i] == '#') {
      s[i] = 'A';
      return;
    }
  }
}

void b_sit(string &s) {
  for(int i=N-1; i>=0; i--) {
    bool ok = (s[i] == '#');
    ok &= (i+1 >= N or s[i+1] != 'A');
    ok &= (i-1 <  0 or s[i-1] != 'A');

    if(ok) {
      s[i] = 'B';
      return;
    }
  }

  for(int i=0; i<N; i++) {
    if(s[i] == '#') {
      s[i] = 'B';
      return;
    }
  }
}

void c_sit(string &s) {
  for(int i=0; i<N; i++) {
    if(s[i] != '#') {
      if(i+1 < N and s[i+1] == '#') {
        s[i+1] = 'C';
        return;
      }
      if(i-1 >= 0 and s[i-1] == '#') {
        s[i-1] = 'C';
        return;
      }
    }
  }

  s[N/2] = 'C';
  return;
}

void d_sit(string &s) {
  int ma = -1, arg = -1;
  for(int i=0; i<N; i++) {
    if(s[i] != '#') continue;
    int min_dist = INF;
    for(int j=0; j<N; j++) {
      if(i == j or s[j] == '#') continue;
      int dist = (i - j > 0 ? i - j : j - i);
      if(min_dist > dist) {
        min_dist = dist;
      }
    }

    if(min_dist != INF and ma < min_dist) {
      ma = min_dist;
      arg = i;
    }
  }

  if(arg < 0) {
    s[0] = 'D';
  }
  else {
    s[arg] = 'D';
  }
}

void sit_down(char x, string &s) {
  if(x == 'A') a_sit(s);
  if(x == 'B') b_sit(s);
  if(x == 'C') c_sit(s);
  if(x == 'D') d_sit(s);
}

int solve() {
  cin >> N >> M;
  if(N == 0 and M == 0) return 1;

  vector<char> A(M);
  string ans(N, '#');
  for(int i=0; i<M; i++) cin >> A[i];
  for(int i=0; i<M; i++) {
    sit_down(A[i], ans);
  }
  cout << ans << endl;
  return 0;
}

int main() {
  while(!solve());
  return 0;
}

