14796 - Narsimha   

Description

The schedule is a disaster.
 
Different formats everywhere, mismatched and confusing.
 
Narsimha’s patience is evaporating faster than my scores in I2P.
 
Only sorting the dates correctly can save the day.
 
                                                                                                                                            ↓   This will be you if you don't help him :(

                              Mahavatar Narsimha Movie Review: India's Biggest Animated Hit

 

You are writing a program to help organize his daily schedule.

You receive a list of dates in different formats:

  • YYYY-MM-DD

  • MM/DD/YYYY

  • DD Mon YYYY (e.g., 25 Oct 2025)

Your task is to sort these dates chronologically from earliest to latest.

 

month_map = { 'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6, 'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12 }

 

Constraints

  • All input dates and formats are valid.

  • No two dates represent the same calendar day.

  • You do not need to check for duplicates.

 

Input

A single line of comma-separated dates.

Output

Print the dates sorted chronologically, one per line.

Original input format is preserved.

Sample Input  Download

Sample Output  Download

Tags




Discuss