#T718. 【NOIP2008-J1】ISBN号码

【NOIP2008-J1】ISBN号码

Description

Every officially published book has a corresponding ISBN number. The ISBN code consists of 9 digits, 1 check digit, and 3 separators, formatted as "x-xxx-xxxxx-x," where the symbol "-" is a 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 code. The first digit of the ISBN code represents the book's publishing language, for instance, 0 stands for English; the three digits after the first separator "-" represent the publisher, such as 670 for Viking Press; the five digits after the second separator represent the book's number within the publisher; and the last digit is the check digit.

The method for calculating the check digit is as follows:

Multiply the first digit by 1, the second digit by 2, and so on. Sum the results and take the modulo 11 of the sum. The remainder is the check digit. If the remainder is 10, the check digit is the uppercase letter X. For example, the check digit 4 in the ISBN code 0-670-82162-4 is calculated as follows: for the 9 digits 067082162, multiply each digit from left to right by 1, 2, ..., 9, respectively, and sum them up: 0×1 + 6×2 + ... + 2×9 = 158. Then take 158 mod 11, which results in 4, as the check digit.


Your task is to write a program to determine whether the check digit in the input ISBN code is correct. If it is correct, simply output "Right"; if it is incorrect, output the correct ISBN code you believe it should be. The input consists of a single line, a character sequence representing an ISBN code (guaranteed to conform to the ISBN format requirements).

Input Format

A single line, a character sequence representing an ISBN code (guaranteed to conform to the ISBN format requirements).

Output Format

One line. If the check digit of the input ISBN code is correct, output "Right"; otherwise, output the correct ISBN code in the specified format (including the separators "-").

```input1 0-670-82162-4 ``` ```output1 Right ``` ```input2 0-670-82162-0 ``` ```output2 0-670-82162-4 ``` ## Source

NOIP2008-J1