#include<stdio.h>
int main()
{
int x1,x2,x3;
int a;
int he;
scanf("%d-%d-%d-%d",&x1,&x2,&x3,&a);
he=x1+x2%10*4+(x2/10)%10*3+(x2/100)*2+x3%10*9+(x3/10)%10*8+(x3/100)%10*7+(x3/1000)%10*6+(x3/10000)*5;
he=he%11;
if(he==a)
{
printf("Right");
}
else
{
printf("%d-%d-%d-%d",x1,x2,x3,he);
}
return 0;
}