In this problem, you need to process the numerical format of the Credit Card number to see which card brand the card belongs to.
As we know, A credit card number is the string of numeric digits that identifies the credit card. It's usually (but not always) displayed on the front of the card, and it generally (but not always) features 15 or 16 digits depending on which brand of the card it is.
Assuming that there is a credit card number as 5569608130275946, we can identify this card as a "Master Card".
To identify the card brand, we need to check the first 1~4 digits on the card, please check the table below:
Figure 1. The index table for credit cards numbers.
Note that, there are only 15 digits for brand "American Express", and the rest of the brands have 16 digits.
However, for this problem, all the digits are reversed as below.
There will be only one line in the input as the reversed credit number, such as:
6495720318069655
(*The original digits would be like this:
5569608130275946
The result after the identification process,
print "Visa Card" if the first 1 digit of the number is 4;
print "Master Card" if the first 2 digits of the number are 51~55;
print "American Express" if there are 15 digits in total and the first 3 digits of the number are 340~379;
print "JCB Card" if the first 3 digits of the number are 300~399, or the first 4 digits of the number are 1800 or 2131;
print "Unionpay Card" if the first 2 digits of the number are 62;
print "Unknown" if the digits don't match the criteria.
For the example input here, we should print "Master Card" as the output.