#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;int main(void){int i,n,m;while(cin>>n>>m&&n!=0&&m!=0){
vector<char> z(n,'#');for(int l=0;l<m;l++){char a;cin>>a;if(a=='A'){for(i=0;i<m;i++){if(z[i]=='#'){z[i]=a;break;}}}
else if(a=='B'){int su=0;for(i=n-1;i>=0;i--){if(z[i]!='#')continue;if(i>=1&&z[i-1]=='A')continue;
if(i<=n-2&&z[i+1]=='A')continue;z[i]=a;su=1;break;}if(!su){for(i=0;i<n;i++){if(z[i]=='#'){z[i]=a;break;}}}}
else if(a=='C'){int su=0;for(i=0;i<n;i++){if(z[i]=='#')continue;
if(i<=n-2&&z[i+1]=='#'){z[i+1]=a;su=1;break;}if(i>=1&&z[i-1]=='#'){z[i-1]=a;su=1;break;}}
if(!su){if(n%2==0){z[(n/2)] = a;}else{z[(n/2)]=a;}}}else if(a=='D'){int ef=1;
for(i=0;i<n;i++){if(z[i]!='#'){ef=0;break;}}if(ef){z[0]=a;continue;}
vector<int> C(n,0);for(i=0;i<n;i++){if(z[i]!='#'){int Y=1;while(i+Y<n&&z[i+Y]=='#'){
if(C[i+Y]==0)C[i+Y] = Y;else C[i+Y]=min(Y,C[i+Y]);Y++;}}}for(i=n-1;i>=0;i--){if(z[i]!='#'){int Y=1;
while(i-Y>=0&&z[i-Y]=='#'){if(C[i-Y]==0)C[i-Y]=Y;else C[i-Y]=min(Y,C[i-Y]);Y++;}}}int su=0,mn,mv=0;for(i=0;i<n;i++){if(C[i]>mv){mn=i;mv=C[i];}}if(mv>1){z[mn]=a;su=1;}if(!su){for(i=0;i<n;i++){if(z[i]=='#'){z[i]=a;break;}}}}}for(i=0;i<n;i++)cout<<z[i];cout<<endl;}return 0;}