int main(){
char str[256];
scanf("%s",str);
int a=0,b=0,c=0;
for(int i=0;i<strlen(str)-4;i+=5){
int temp;
switch(str[i+3]){
case 'a':
temp=a;
break;
case 'b':
temp=b;
break;
case 'c':
temp=c;
break;
default:
temp=str[i+3]-'0';
break;
}
if(str[i]=='a')a=temp;
else if(str[i]=='b')b=temp;
else c=temp;
}
printf("%d %d %d",a,b,c);
}