#include<bits/stdc++.h>
using namespace std;
int main()
{
string s,l;
int n=0;
cin>>s;
int a=0,i=0,L;
while(i<=10)
{
if (i==0) {a=a+(int(s[0]-'0'));}
else if (i>=2 && i<=4) {a=a+(int(s[i]-'0'))*i;}
else if (i>=6 && i<=10) {a=a+(int(s[i]-'0'))*(i-1);}
i++;
}
L=a%11;
if (L==10) {l="X";}
else if (L==0) {l="0";}
else if (L==1) {l="1";}
else if (L==2) {l="2";}
else if (L==3) {l="3";}
else if (L==4) {l="4";}
else if (L==5) {l="5";}
else if (L==6) {l="6";}
else if (L==7) {l="7";}
else if (L==8) {l="8";}
else if (L==9) {l="9";}
if (L==int(s[12]-'0')) {cout<<"Right";}
else
{
while (n<=11)
{
cout<<s[n];
n++;
}
cout<<l;
}
return 0;
}