#include <stdio.h>
#include<string.h>
int main() {
    char str[15];
    char m=-1;
    scanf("%s",str) ;
    int sum , j;
    int len =strlen(str);
    sum=str[0]-'0'+(str[2]-'0')*2+(str[3]-48)*3+(str[4]-48)*4+(str[6]-48)*5+(str[7]-'0')*6+(str[8]-48)*7+(str[9]-'0')*8+(str[10]-'0')*9;
        sum=sum%11;
        switch (sum)
        {
            case 0: {m = '0'; break; }
            case 1: {m = '1'; break; }
            case 2: {m = '2'; break; }
            case 3: {m = '3'; break; }
            case 4: {m = '4'; break; }
            case 5: {m = '5'; break; }
            case 6: {m = '6'; break; }
            case 7: {m = '7'; break; }
            case 8: {m = '8'; break; }
            case 9: {m = '9'; break; }
            case 10: {m = 'X'; break; }
        }
        if(m==str[12])
        {
            printf("Right");
        }
        else {
            str[12]=m;
            printf("%s",str);
        }

    return 0;
}