14413 - Temmie's college life   

Description

Temmie is a freshman at Tsinghua University. Upon enrollment, he learned about his student ID, which consists of a college code C and a string of numbers ID.


He is curious about what other people's student IDs represent, so based on the given college code and student ID, please calculate the following information according to the rules:

  1. Degree: If the alphabetical order of the college letter C is <= 'L', then the student is a "Bachelor", otherwise a "Master" (without quotation marks)
  2. Class: The third digit from the end of the student ID, where 1 represents 'A', 2 represents 'B', and so on (without quotation marks)
  3. Enrollment year: The number formed by the first three digits of the student ID
  4. Seat number: The number formed by the last two digits of the student ID

Hint: Please use strings in C to solve this problem.

 

 

Input

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

 

Constraints

  • C is an uppercase letter.
  • The length of ID is 10. (May include leading zeros)
  • for all i in [1,10], 0 ≤ id≤ 9
  • id8 ≠ 0

Output

The output consists of four lines, each containing a string or an integer, representing the degree (string), class (string), enrollment year (integer), and seat number (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