14414 - Fishhh's military career   

Description

Fishhh is about to join the military, and unfortunately, he has to serve one year of mandatory service. Upon receiving his draft notice, he got his recruit information, including a military branch represented by a single English letter C, and a 20-digit ID number. He's worried about reporting to the wrong place, so he needs your help to calculate the following information:

  1. Military Branch: Lowercase letter represents Navy, uppercase letter represents Army
  2. Battalion: The first 3 digits of the ID number
  3. Company: The 4th to 8th digits of the ID number
  4. Platoon: The 16th digit from the front of the ID number (5th from the end), where 1 represents A, 2 represents B, and so on
  5. Group: The remainder of the ID number divided by 4, plus 1

Input

The input consists of only one line, containing a character C and a string ID of length 20 composed of digits 0-9 (may have leading zeros), separated by a space.

 

Constraints

  • C will only be an uppercase or lowercase English letter.
  • The length of ID is 20. (May include leading zeros)
  • for all i in [1,20], 0 ≤ id≤ 9
  • id16 ≠ 0

 

Subtasks

  • Testcases 1~3: ID has 11 leading zeros.
  • Testcases 4~5: ID has 3 leading zeros.
  • Testcases 6~10: No additional restrictions.

Output

The output consists of five lines, each containing a string or an integer, representing:

Military Branch (string), Battalion (integer), Company (integer), Platoon (string), and Group (integer).

"integer" means it doesn't include any unnecessary leading zeros.

 

 

Please remember to print "\n" at the end.

 

Sample Input  Download

Sample Output  Download

Tags




Discuss