Print a one-month calendar, given the weekday on which the first day of the month falls and the number of days in the month.
Input
One line with two space-separated integers:
- the weekday of the first day of the month (
1 for Sunday, 2 for Monday, …, 7 for Saturday), and
- the number of days in the month (an integer from
28 to 31, inclusive).
All input is guaranteed to be valid.
Output
Print the calendar for the month using the following layout:
- The first line is always the fixed header
Sun Mon Tue Wed Thr Fri Sat.
- Below the header, print the days one week per line, from Sunday to Saturday.
- Each day is right-aligned in a column three characters wide, and adjacent columns are separated by a single space.
- Cells before the first day of the month are left blank. No line may contain trailing whitespace, and the last line must end with a newline.