Given a date, can you compute its corresponding day of the week? For instance, the day of the week of de date 2 October 2024 is Wednesday.
Remember that the days of the week are Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday. Also, common years have 365 days. At most once every four years, we have a leap year of 366 days. 2024 is a leap year.
These are the months and their lenghts:
Input
Input consists of several dates, all in the format day month year. All years are between 2021 and 2027, and all dates are correct.
Output
For every given date, print its day of the week.
Input
2 October 2024 31 December 2027 29 February 2024
Output
Wednesday Friday Thursday