#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
char e,f,g,d;
cin>>a>>e>>b>>f>>c>>g>>d;
int a1,b1,c1,d1,e1,f1,g1,h1,i1;
a1=a;
b1=b/100;
c1=b%100/10;
d1=b%10;
e1=c/10000;
f1=c%10000/1000;
g1=c%1000/100;
h1=c%100/10;
i1=c%10;
int x=a1*1+b1*2+c1*3+d1*4+e1*5+f1*6+g1*7+h1*8+i1*9;
x=x%11;
if(d=='X')
{
if(x==10)
{
cout<<"Right";
}
else
{
cout<<a<<"-"<<b<<"-"<<c<<"-"<<x%11;
}
}
else
{
int y=d;
y=y-48;
if(x==y)
{
cout<<"Right";
}
else
{
cout<<a<<"-"<<b<<"-"<<c<<"-"<<x%11;
}
}
return 0;
}