#include<bits/stdc++.h>
using namespace std;
string a;
string b;
long long s=1,total=0;
int main()
{
cin>>a;
for(int d=0;d<13;d++)
{
if(d==1 || d==5 ||d==11)
{
continue;
}
b[s]=a[d];
s++;
}
for(int q=1;q<=9;q++)
{
if(b[9]=='X')
{
total+=10*q;
break;
}
else
total+=((b[q]-'0')*q);
}
total=total%11;
if(total==10)
{
total='X';
}
if(total=='X'&&b[10]=='X')
{
cout<<"Right";
return 0;
}
if((total+'0')==b[10])
{
cout<<"Right";
}
else
{
for(int q=0;q<12;q++)
{
cout<<a[q];
}
cout<<total;
}
}