#include<bits/stdc++.h>
using namespace std;
string s;
int ctoi(char a){
int b = a - '0';
return b;
}
int solve(void){
int nowdigit = 1;
long long modSum = 0;
for(char c : s){
if(c == '-'){
continue;
}else{
modSum += nowdigit * ctoi(c);
nowdigit++;
if(nowdigit > 9){
return modSum % 11;
}
}
}
return 0;
}
int main(){
stringstream ansISBN;
cin >> s;
int ID = solve();
for(int i=1; i<=13; i++){
if(i == 13){
if(s[i-1] == ID){
cout << "Right" << endl;
}else if(s[i-1] == 'X' && ID == 10){
cout << "Right" << endl;
}else{
cout << ansISBN.str() << ID << endl;
}
}else{
ansISBN << s[i-1];
}
}
return 0;
}