program p1009;
var
i,k:longint;
a:array[1..10] of char;
b:array[1..10] of integer;
c:char;
begin
assign(input,'isbn.in');
assign(output,'isbn.out');
reset(input);
rewrite(output);
k:=0;
read(a[1]);
read(c);
for i:=2 to 4 do read(a[i]);
read(c);
for i:=5 to 9 do read(a[i]);
read(c);
read(a[10]);
for i:=1 to 9 do
begin
b[i]:=ord(a[i])-48;
k:=k+b[i]*i;
end;
if (k mod 11=ord(a[10])-48)and(a[10]<>'X')
or
(k mod 11=ord(a[10])-78)and(a[10]='X')
then writeln('Right')
else
begin
b[10]:=k mod 11;
if b[10]=10 then
begin
write(b[1]);
write(c);
for i:=2 to 4 do write(b[i]);
write(c);
for i:=5 to 9 do write(b[i]);
write(c);
write('X');
end else
begin
write(b[1]);
write(c);
for i:=2 to 4 do write(b[i]);
write(c);
for i:=5 to 9 do write(b[i]);
write(c);
write(b[10]);
end;
end;
close(input);
close(output);
end.