import java.util.*;
public class Main64 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while(in.hasNext()) {
int m = Integer.parseInt(in.nextLine());
int n = Integer.parseInt(in.nextLine());
String str = in.nextLine();
char[] ch = str.toCharArray();
int v; //配置所占容量
int[] c = new int[n]; //板卡上的芯片
for(int i=0; i < ch.length; i++){
if(ch[i] == 'B') v = 2;
else if(ch[i] == 'A') v = 1;
else v = 8;
for(int k = 0; k < n; k++){
int second = c[k]; //芯片占用的情况
if(v <= m - second){ //芯片所剩容量大于等于配置所占容量
c[k] = c[k] + v;
break;
}
}
}
for(int l : c){
int second= l; //芯片占用的情况
StringBuilder ans = new StringBuilder();
for(int i = 0; i <= m - 1; i++){
if(second <= i) ans.append("0"); //芯片占用的地方为1,未占用为0
else ans.append("1");
}
System.out.println(ans);
}
}
}
}