Program isbn;
Var
I,J,T:Integer;
S:String;
Begin
Assign(Input,'isbn.in');
Assign(Output,'isbn.out');
Reset(Input);
Rewrite(Output);
Readln(S);
T:=0;
J:=0;
For I:=1 To Length(S)-2 Do
Begin
If S[I]='-' Then Continue;
Inc(J);
T:=T+(Ord(S[I])-48)*J;
End;
T:=T Mod 11;
If (T=10) And (S[I+2]='X') Or (S[I+2]=Chr(T+48))
Then Writeln('Right')
Else Begin
For I:=1 To Length(S)-1 Do Write(S[I]);
If T=10 Then Writeln('X')
Else Writeln(T);
End;
Close(Input);
Close(Output);
End.