#include <iostream>
#include <string>
using namespace std;
int identification[15], code[13], ans=0;
int main()
{
for (int i = 1; i <=13; i++)
{
cin >> identification[i];
if(i!=2 || i!=6 || i!=12)
for (int j = 1; j <= 10; j++)
{
code[j]=identification[i];
ans+code[j]*(j-1);
}
}
ans=ans%11;
if (ans==10) ans=X;
if (ans==identification[13])cout << "Right" << endl;
else identification[13]=ans;
for (int i = 1; i <=13; i++)
{
cout << identification[i];
}
return 0;
}