# POTD 6 skel
# Author: <anonymized>
# Date: Oct 2, 2025
# Description: Convert 12-hour time format into 24-hour format

from sys import argv as a
print('%02d:%02d'%(int(a[1])%12+12*(a[3]=='PM'),int(a[2])))