LearnPy Hub
← Operators problems
Hard

Day of the Week by Formula

Read a date as DD MM YYYY. Use Zeller's congruence (treat January and February as months 13 and 14 of the previous year): h = (q + 13(m + 1) // 5 + K + K // 4 + J // 4 + 5J) % 7, where K is the year % 100 and J is the year // 100. h = 0 means Saturday, 1 Sunday, … 6 Friday. Print the day name.

Input

Three integers.

Output

One word.

Sample 1

Input
14 11 2026
Output
Saturday

Sample 2

Input
26 3 1971
Output
Friday
solution.py
Output appears here
Day of the Week by Formula · Python practice problem · LearnPy Hub