#include<stdio.h>
int main (void)
{
int n, value, value1, value2, sum=0, x, value3, qian=1000, y=0, jishuqi=0;
scanf("%d", &n);
value=n/100000000;
if(value!=0){
printf("%cY", 'a'+value);
}
value1=n%100000000;
value2=value1/10000;
while(qian!=0){
if(value2==0){
break;
}
x=value2/qian;
value2=value2%qian;
qian=qian/10;
y++;
if(value==0&&x==0){
if(jishuqi!=1){
continue;
}
}
if(x==0){
sum++;
if(sum<=1) {
if(y!=4){
printf("%c", 'a');
}
}
}
if(x!=0){
sum=0;
jishuqi=1;
printf("%c", 'a'+x);
switch(y){
case 1: printf("Q"); break;
case 2: printf("B"); break;
case 3: printf("S"); break;
}
}
}
if(y!=0){