#include <iostream>
using namespace std;
int main() {
string instr, str=""; //instr表示输入的ISBN,str是ISBN中的数字
cin >> instr;
//将ISBN中的9位数字和1位识别码取出来
for (int i = 0; i < instr.length(); i++) {
if (instr[i] != '-') {
str += instr[i];
}
}
//计算前9位数字之和
int sum = 0;
for (int i = 0; i < str.length() - 1; i++) {
sum += ((str[i] - '0') * (i + 1));
}
//判断余数是否和识别码一致
int mod = sum % 11;
if (mod == (str[9] - '0')) {
cout << "Right";
}
//当mod=10时
else if (mod == 10) {
//如果识别码正确
if (str[9] == 'X') {
cout << "Right";
}
//如果识别码不正确,就纠正一下,
else {
instr[12] = 'X';
cout << instr;
}
}
//当模和识别码不一致时
else {
instr[12] = mod+'0';
cout << instr;
}
system("pause");
return 0;
}