#t197. ISBN号码
ISBN号码
ISBN Number
Problem Description
Every officially published book has an ISBN number. An ISBN code consists of digits, check digit, and separators, in the format "x-xxx-xxxxx-x", where the symbol - is the separator (the minus sign on the keyboard) and the last character is the check digit. For example, 0-670-82162-4 is a standard ISBN code. The first digit of the ISBN indicates the publication language of the book (e.g. 0 means English); the three digits after the first - represent the publisher (e.g. 670 represents Viking Press); the five digits after the second separator represent the book's number within the publisher; and the last character is the check digit.
The check digit is computed as follows:
Multiply the first digit by , the second digit by , and so on; take the result modulo , and the remainder is the check digit. If the remainder is , the check digit is the uppercase letter X. For example, the check digit in ISBN 0-670-82162-4 is obtained as follows: for the digits 067082162, multiply from left to right by respectively and sum them up, i.e. , then take as the check digit.
Your task is to write a program to determine whether the check digit of the input ISBN number is correct. If it is correct, output Right; if it is wrong, output what you think is the correct ISBN number.
Input Format
A single line, a character sequence representing an ISBN number of a book (guaranteed to conform to the ISBN format).
Output Format
One line in total. If the check digit of the input ISBN is correct, output Right; otherwise, output the correct ISBN number (including the - separators) in the required format.
Sample Input 1
0-670-82162-4
Sample Output 1
Right
Sample Input 2
0-670-82162-0
Sample Output 2
0-670-82162-4