Input (grade 13): In common years January starts on the same day of the week as October, but no other month starts on the same day of the week as October in leap years as the month begins on the same day of the week as August of the previous year. October ends on the same day of the week as February every year and January in common years only.
Output (grade 6): October begins on the same day of week as January, except in leap years.