import locale
from datetime import datetime
s = """
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
"""
s=s*50000
fmt = "%d %b @ %I:%M%p"
for d in sorted((line for line in s.split("\n") if len(line)), key=lambda x:datetime.strptime(x, fmt)):
print(d)# your code goes here
aW1wb3J0IGxvY2FsZQoKZnJvbSBkYXRldGltZSBpbXBvcnQgZGF0ZXRpbWUKCnMgPSAiIiIKNiBKYW4gQCA0OjAzcG0KOCBKYW4gQCAyOjE3cG0KOSBEZWMgQCA0OjAwYW0KOSBEZWMgQCA1OjE0cG0KOSBEZWMgQCA1OjI4YW0KMTAgSmFuIEAgMjo1NXBtCjEwIEphbiBAIDQ6MjFhbQoxMCBKYW4gQCA3OjE0cG0KMTIgRGVjIEAgNzo0OHBtCjEyIERlYyBAIDc6NTBwbQoxMiBKYW4gQCAzOjMycG0KMTMgRGVjIEAgMzo0M3BtCjEzIERlYyBAIDU6MDJhbQoxMyBEZWMgQCA1OjI0YW0KMTQgSmFuIEAgNToxN3BtCjE1IEphbiBAIDU6MjlhbQoyMSBEZWMgQCAzOjU2cG0KMjEgRGVjIEAgOTo0MGFtCiIiIgpzPXMqNTAwMDAKCgpmbXQgPSAiJWQgJWIgQCAlSTolTSVwIgpmb3IgZCBpbiBzb3J0ZWQoKGxpbmUgZm9yIGxpbmUgaW4gcy5zcGxpdCgiXG4iKSBpZiBsZW4obGluZSkpLCBrZXk9bGFtYmRhIHg6ZGF0ZXRpbWUuc3RycHRpbWUoeCwgZm10KSk6CglwcmludChkKSMgeW91ciBjb2RlIGdvZXMgaGVyZQ==