#include<stdio.h>
#include<stdlib.h>
char a[20];
int num[9];
char yan=0,bian;
int main()
{
freopen("1.in","r",stdin);
freopen("1.out","w",stdout);
int i,j=1;
for(i=0;i<12;i++)
{
scanf("%c",&a[i]);
if(a[i]!='-')
num[j++]=a[i]-'0';
}
a[i]='\0';
for(i=1;i<=9;i++)
yan=(yan+num[i]*i)%11;
if(yan!='X')
yan=yan+'0';
else
yan='X';
scanf("%c",&bian);
if(bian==yan)
printf("Right");
else
printf("%s%c",a,yan);
return 0;
}