#include <stdio.h>
#include <math.h>
int main(){
char a[101];
int i=0;
while(scanf("%s",&a)!=EOF){
i=0;
while(a[i]){
if((a[i]-65>=0)&&(a[i]-65<25)){
a[i]=a[i]+33;
}else if(a[i]-65==25){
a[i]=a[i]+7;
}else if((a[i]-97>=0)&&(a[i]-97<=25)){
if((a[i]>=115)&&(a[i]<=122)){
a[i]=a[i]-1;
}
int j=ceil((a[i]-96)/3.0)+1;
if(a[i]-97==24){
j=9;
}
a[i]=48+j;
}
i++;
}
printf("%s\n",a);
}
return 0;
}