HR of Synergy plans to set two specific weekend days for employees for the period from a given starting date to an ending date. These weekend days will remain fixed throughout the specified period, and the objective is to maximize the total number of working days, excluding both public holidays and weekend days.
The dates should follow the Gregorian calendar, meaning they should align with the standard calendar system, including leap years. A leap year is defined as any year that:
For example:
In leap years, February has 29 days instead of the usual 28.
A working day is any day that is neither a public holiday nor a designated weekend day. The HR wants to select two specific days of the week that will serve as weekend days. Your task is to help him choose these two days such that the total number of working days is maximized.
The input consists of multiple lines:
For each test case:
Each test case should be processed independently.
The sum of $$$H$$$ over all the test cases will not exceed $$$2000$$$.
All the date ranges are between '01-01-1900' and '31-12-3000', inclusive. The dates are guaranteed to be valid.
For each test case, output a single line containing two space-separated, title-cased days (e.g., "Friday Saturday") representing the weekend maximizing working days. Days are: 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'. If multiple pairs achieve this, output the lexicographically smallest (alphabetical order, comparing the first days, then the second). Note that "Saturday Friday" and "Friday Saturday" are considered different pairs.
For example:
110-10-2024 24-10-2024505-0111-10-202412-1015-10-202405-01-2024
Friday Saturday
| Name |
|---|


