Day of the week

Given a date, can you compute its corresponding day of the week? For instance, the day of the week of the 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.

Problem information

Author: Salvador Roura

Generation: 2026-01-25T12:03:45.265Z

© Jutge.org, 2006–2026.
https://jutge.org