#include <stdio.h>

int main() {
    char ISBN[14];
    int sum = 0, k = 1;
    scanf("%s", ISBN);
    for (int i = 0; i < 12; ++i) {
        if (ISBN[i] >= '0' && ISBN[i] <= '9') {
            sum += (ISBN[i] - '0') * k;
            k++;
        }
    }
    sum %= 11;
    char ret = '0';
    if(sum == 10)
        ret = 'X';
    else
        ret = sum + '0';
    if (ISBN[12] == ret)
        printf("Right");
    else {
        ISBN[12] = ret;
        printf("%s", ISBN);
    }
    return 0;
}