#T770. 服务器的维护

服务器的维护

Description

As is well known, the price of a server is xxx. To improve judging efficiency, CodesOnline purchased n servers at once and installed the Liuux operating system on all of them. However, the Liuux system on these servers is quite peculiar—it requires outputting a specific character to be usable.

The specific character is determined by two factors: the boot time and whether the boot was successful.
The boot time format is mm-dd-hh (where m, d, and h represent month, day, and hour respectively, and mm represents a two-digit month).
The boot method: if the boot is successful, it is A; if unsuccessful, it is B.

The specific character format is: mm-dd-hh-A or mm-dd-hh-B.

Input Format

The input consists of two lines:

  • The first line is the boot time, with three numbers m, d, h, separated by spaces.
  • The second line is the boot method, either A or B.

Output Format

  • The first line: Output the specific character.
    Requirements for the specific character:

    • Format: mm-dd-hh-A/B, where the string must not contain 0 or -.
    • Finally, reverse the string and output it.
  • The second line: Output the length of the string.

Example Input

12 3 4  
A  

Example Output

A-43-21  
7  

Explanation

The boot time is December 3rd, 4 o'clock, and the boot method is A.
The formatted string is 12-3-4-A.
After removing 0 and -, it becomes 1234A.
Reversing it gives A4321.
The length is 5.

(Note: The example explanation seems inconsistent with the output. The correct steps should be:

  1. Original formatted string: 12-3-4-A.
  2. Remove 0 and -: 1234A.
  3. Reverse: A4321.
  4. Length: 5.
    But the example output shows A-43-21 and length 7, which contradicts the requirements. Please clarify the rules if necessary.)

Assuming the correct requirement is to remove 0 and - before reversing, the translation is as above. If the rules are different, adjustments may be needed.

(Note: The original problem description seems to have inconsistencies between the example and the rules. The translation follows the rules as stated, but the example may need correction.)

10 5 12
B
B2151
5

Source

Original question by CodesOnline