#include<bits/stdc++.h>
using namespace std;
int main(){
char a[10],c=0;
int b=1,d=0,e=0;
while(1==1){
if(b==11){
break;
}
cin>>c;
if(c>='0' && c<='9'){
a[b]=c;
}else if(c=='X'){
a[b]==10;
}else{
continue;
}
b++;
}
for(int i=1;i<=9;i++){
e+=i*(a[i]-48);
}
d=e%11;
if(a[10]-48==d){
cout<<"Right";
}else{
for(int i=1;i<=9;i++){
cout<<a[i];
if(i==1 || i==4 ||i==9){
cout<<"-";
}
}
if(d==10){
cout<<"X";
}else{
cout<<d;
}
}
return 0;
}