import java.util.Scanner;
public class Solution
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
System.out.print("Enter the ISBN: ");
String isbn = input.nextLine();
input.close();
int numberOfISDN = Integer.parseInt(isbn.substring(0, 9));
int sum = 0;
for(int i = 9; i > 0; i--)
{
sum += (numberOfISDN % 10) * i;
numberOfISDN /= 10;
}
if(sum % 11 == isbn.charAt(9))
System.out.println("Valid ISBN");
else if(sum % 11 == 10 && isbn.charAt(9) == 'X')
System.out.println("Valid ISBN");
else
System.out.println("Invalid ISBN");
}
}