#include<iostream>
using namespace std;
int main() {
string s;
while(cin>>s) {
int t[26]={2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,7,8,8,8,9,9,9,9};
for(int i=0;i<s.length();i++) {
if((s[i]=='1') || (s[i]=='0') || (s[i]=='-'))
cout<<s[i];
else cout<<t[(int)s[i]-65];
} cout<<'\n';
}
}