After the Code Goddess found Somnath in his secret location, she feels sorry for him and instead of redirecting him to /dev/null/
, she decides to punish him by giving poorly written code to debug at various times of the day. The Code Goddess gives the time of day in 24 Hours format but since Somnath is very weak at solving problems, you, the expert, must help him by converting it to 12 Hours format.
Input Format
The first line will contain a number T
indicating the number of test cases.
The next T lines contains the hour of the day in 24 hrs format HHMM
.
Output Format
Print out the 12 Hours equivalent time in a new line in the format
HHMMAM
or HHMMPM