import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String s = scanner.next();
if (cheak(deal(s)) == -1) {
System.out.println("Right");
} else {
restore(s, cheak(deal(s)));
}
}
public static int[] deal(String s) {
int[] arr = new int[10];
int j = 0;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) != '-') {
arr[j] = s.charAt(i) - 48;
j++;
}
}
return arr;
}
public static int cheak(int[] arr) {
int c = 1, sum = 0, sbm;
for (int i = 0; i < arr.length - 1; i++) {
sum = sum + arr[i] * c;
c++;
}
sbm = arr[9];
if (sbm == sum % 11 || (sbm == 40 && sum % 11 == 10)) {
return -1;
} else {
return sum % 11;
}
}
public static void restore(String s, int i) {
String s2 = s.substring(0, s.length() - 1);
if (i == 10) {
System.out.println(s2 + "X");
} else {
System.out.println(s2 + i);
}
}
}