#P242. 【例40.3】ISBN码

【例40.3】ISBN码

Description

Every officially published book has a corresponding ISBN number. The ISBN consists of 9 digits, 1 check digit, and 3 separators, with the format "x-xxx-xxxxx-x", where the hyphen "-" is the separator (the minus sign on the keyboard), and the last digit is the check digit. For example, "0-670-82162-4" is a standard ISBN. The first digit indicates the language of publication (e.g., 0 for English); the three digits after the first hyphen indicate the publisher (e.g., 670 for Viking Press); the five digits after the second hyphen indicate the book's number at the publisher; the last digit is the check digit.
The check digit is calculated as follows:
Multiply the first digit by 1, the second by 2, and so on, up to the ninth digit by 9, sum the results, and take the result modulo 11. The remainder is the check digit. If the remainder is 10, the check digit is the uppercase letter 'X'. For example, in the ISBN "0-670-82162-4", the check digit 4 is obtained as follows: for "067082162", multiply each digit from left to right by 1, 2, ..., 9, sum them, i.e., 0×1+6×2+...+2×9=158, then 158 mod 11 is 4, which is the check digit.
Your task is to write a program to determine whether the check digit in the input ISBN is correct. If it is correct, output "Right"; if not, output the correct ISBN (including hyphens).

Input Format

A single line, a character sequence representing the ISBN number of a book (guaranteed to conform to the ISBN format).

Output Format

A single line: if the check digit in the input ISBN is correct, output "Right"; otherwise, output the correct ISBN (including hyphens).

Sample

0-670-82162-4
Right