#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

int main() {
  int n, m;
  while(cin>>n>>m,n+m) {
    vector<char> v(n, '#');
    REP(j,m) {
      char c;
      cin >> c;
      if (c=='A') {
        REP(i,n) {
          if (v[i] == '#') {
            v[i] = c;
            break;
          }
        }
      } else if (c=='B') {
        bool f = 0;
        for(int i=n-1;i>=0; --i) {
          if (v[i] == '#') {
            if (i<n-1&&v[i+1]=='A' || i>0&&v[i-1]=='A')
              continue;
            v[i] = c;
            f = 1;
            break;
          }
        }
        if (f) continue;
        REP(i,n) {
          if (v[i] == '#') {
            v[i] = c;
            break;
          }
        }
      } else if (c=='C') {
        bool f = 0;
        REP(i,n) {
          if (v[i] != '#') {
            if (i>0&&v[i-1]=='#') {
              v[i-1] = c;
              f = 1;
              break;
            }
            if (i<n-1 && v[i+1]=='#') {
              v[i+1] = c;
              f = 1;
              break;
            }
          }
        }
        if (f) continue;
        if (n%2)
          v[(n+1)/2-1] = c;
        else
          v[n/2] = c;
      } else {
        vector<int> dst(n,INF);
        REP(i,n) REP(j,n)
          if (v[j] != '#')
            dst[i] = min(dst[i], abs(i-j));
        int ma = 0;
        int p = 0;
        REP(i,n) {
          if (v[i] == '#' &&ma < dst[i]) {
            ma = dst[i];
            p = i;
          }
        }
        v[p] = c;
      }
    }
    REP(i,n)
      cout << v[i];
    cout << endl;
  }
}