import re
import datetime

inp = '''
6 Jan @ 4:03pm
8 Jan @ 2:17pm
9 Dec @ 4:00am
9 Dec @ 5:14pm
9 Dec @ 5:28am
10 Jan @ 2:55pm
10 Jan @ 4:21am
10 Jan @ 7:14pm
12 Dec @ 7:48pm
12 Dec @ 7:50pm
12 Jan @ 3:32pm
13 Dec @ 3:43pm
13 Dec @ 5:02am
13 Dec @ 5:24am
14 Jan @ 5:17pm
15 Jan @ 5:29am
21 Dec @ 3:56pm
21 Dec @ 9:40am
'''

regex = re.compile(r'(\d+ \w+) @ (\d+:\d+)(\w[m])')
dates = regex.findall(inp)

listofdates = []
out = []
    
for i in range(0, len(dates)):
    dt = datetime.datetime.strptime(dates[i][0] + ' ' + dates[i][1] + dates[i][2], "%d %b %I:%M%p")
    listofdates.append(dt)

listofdates.sort()

for i in range(len(listofdates)):
    at = listofdates[i].strftime('%d %b @ %I:%M%p')
    out.append(at)

print('\n'.join(out))