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