#include<bits/stdc++.h>
using namespace std;
int n,cur,a,b,c;
char d;
main(){
ios::sync_with_stdio(0);
scanf("%d-%d-%d-%c",&a,&b,&c,&d);
n+=a;
n+=b/100*2+b%100/10*3+b%10*4;
n+=c/10000*5+c%10000/1000*6+c%1000/100*7+c%100/10*8+c%10*9;
n%=11;
//cout<<n<<" "<<d;
//if(n==t)cout<<"cmsndhhhd";
int t=d-48;
if(n==10&&d=='X')cout<<"Right";
else if(n==t)cout<<"Right";
else{
printf("%d-%d-%d-",a,b,c);
if(n==10)cout<<"X";
else cout<<n;
}
}