LogiQuest

331. 12-Hour to 24-Hour Time

EasyParsing

Convert a time like 07:05:45PM to 24-hour format 19:05:45.

Input format

A single time hh:mm:ssAM or hh:mm:ssPM.

Output format

The 24-hour time.

Example 1

Input

07:05:45PM

Output

19:05:45

Example 2

Input

12:00:00AM

Output

00:00:00

Constraints

Valid time.

Read input from standard input and print the answer to standard output. Your code is judged against 5 test cases, most of them hidden.

Loading the MyLoginn IDE…