12832 - GEC1506-TW ID number Verification   

Description

In this problem, you need to process the numerical format of the TW ID number to see whether the ID number is true or not.

 

Assuming that there is an ID number as M140051653, the alphabet in the ID number is the registered city/county and the rest numbers are used to verify the ID number.

To make sure the ID number is a verified ID, we need to follow the rules:

  1. Convert the alphabet M to numerical form as 21. (We will provide the mapping table in the Input)
  2. Present all the digits of the ID number (M140051653) as a numerical form (21140051653).
  3. For each digit, we multiply with a given number as:
    n_{1}\times 1+n_{2}\times 9+n_{3}\times 8+n_{4}\times 7+n_{5}\times 6+n_{6}\times 5+n_{7}\times 4+n_{8}\times 3+n_{9}\times 2+n_{{10}}\times 1+n_{{11}}\times 1
  4. Sum all the multiplied result.
  5. As a qualified ID number, the remainder of the sum result divided by 10 should be 0.

Input

The 1st line to the 4th line is the required mapping table for alphabet and its number, such as:

K,19
M,21
N,22
O,35

The 5th line is the ID number to be verified, such as:

M140051653

 

Note that the candidate will not be the same for different test cases.

Output

The result after the verification process, print "True" if the ID number is qualified, otherwise, print "Fake"

 

Sample Input  Download

Sample Output  Download

Tags




Discuss