include <stdio.h>
int main(void)
{
int i, m=1, n=0;
char isbn[14],mod[12] = "0123456789X";
scanf("%s", isbn);
for (i = 0; i < 12; i++)
{
if (isbn[i] != '-')
{
n += (isbn[i] - '0') * m;
m++;
}
}
n = n % 11;
if (n == isbn[13])
printf("Right");
else
{
isbn[12] = mod[n % 11];
printf("%s", isbn);
}
return 0;
}