rt
#include <bits/stdc++.h>
using namespace std;
int main()
{
bool language;
int num , publish , right_check_code = 0;
char ch , check_code;
string s;
cin >> language >> ch >> publish >> ch >> num >> ch >> check_code;
s = to_string( language );
s += to_string( publish );
s += to_string( num );
for( int i = 0 ; i < s.length() ; ++i )
right_check_code += ( s[i] - '0' ) * ( i + 1 );
right_check_code %= 11;
if( right_check_code == check_code - '0' || ( right_check_code == 10 && check_code == 'X' ) )
cout << "Right" << endl;
else if( right_check_code != 10 )
cout << setfill('0') << language << ch << setw(3) << publish << ch << setw(5) << num << ch << right_check_code << endl;
else
cout << setfill('0') << language << ch << setw(3) << publish << ch << setw(5) << num << ch << 'X' << endl;
return 0;
}