# ETAPE 1
import datetime
# ETAPE 2
toutesLesDates = []
reponse = 'oui'
while (reponse.lower() == 'oui'):
DD = int(input('Jour: '))
while(1 <= DD <= 31):
DD = int(input('Jour: '))
MM = int(input('Mois: '))
while (1 <= MM <= 12):
MM = int(input('Mois: '))
YYYY = int(input('Année: '))
while (1000 <= YYYY <= 9999):
YYYY = int(input('Année: '))
toutesLesDates.append(datetime.datetime(YYYY, MM, DD))
reponse = str(input('Saisir une autre date? '))
# ETAPE 3
toutesLesDates.sort()
for date in toutesLesDates:
print(date)