What day is the first day of a month?

  1. We have learned how to calculate the Day Number of a specific day in a month, and how to calculate what day January 1st of a specific year is.
  2. Combining the above two programs, we can easily calculate what day the first day of a month is.
  3. Suppose in a year, January 1st is on day D, and the "Day Number" of the first day of a month is N, then the first day of that month is on day (N + D - 1) % 7. (0:Sunday 6:Saturday)
  4. Write a program that accepts a date in the form "YYYY.MM" and outputs the day of the first day in that month.

The program may run as follows:

Input a month (YYYY.MM) -- 2014.11
The first day of 2014.11 is Saturday.


Input a month (YYYY.MM) -- 2014.1
The first day of 2014.1 is Wednesday.


Input a month (YYYY.MM) -- 2014.12
The first day of 2014.12 is Monday.