#include <iostream>
using namespace std;
int main(){
string str;
int num = 0;
cin >> str;
for (int i = 0, j = 1; i < str.size() && j <= 9; i ++ ){
if(str[i] == '-') continue;
num += (str[i] - '0')*j;
j ++;
}
num %= 11;
int verify;
if(str[12] == 'X')verify = 10;
else verify = str[12] - '0';
if(num == verify)cout << "Right";
else{
cout << str.substr(0, 11) << '-';
if(num == 10) cout << 'X';
else cout << num;
}
return 0;
}