During his summer vacation, Harry Potter received a letter from Hogwarts School saying that he had been appointed the captain of the Gryffindor Quidditch team. In order to prepare his team for the first match of the season, Harry has to make up a training
schedule. He wants to assign Quidditch practices to some fixed days of the week, for example, every Friday and Sunday. Harry thinks that not less than A practices are necessary in order to train the team for the match. On the other hand, the total
number of practices must not exceed B, otherwise the team may overstrain itself and will not be able to perform well at the match. Practices may be held from the 2nd of September to the day preceding the day on which the match will take place, and the match will take place before Christmas. Help Harry to make up the schedule of practices.
Input
In the first line there is the day of the week on which the 1st of
September falls this year. The second line contains the date of the first match in the format "Month Day". This date is in the range from September 2 to December 24. The third line contains the numbers A and B (1 ≤ A ≤ B ≤ 200)
mentioned earlier.
Output
If it is impossible to make up a schedule satisfying the given conditions, then output "Impossible". Otherwise, output in the first line the number of days of the week to which practices should be assigned. In the following lines, give a list of these days in an arbitrary order, one day in a line.
Samples
input | output |
---|
Thursday
September 10
9 20
| Impossible
|
Tuesday
October 7
12 14
| Impossible
|
Friday
October 4
12 14
| 3
Monday
Wednesday
Saturday
|
Problem Author: Idea and text - Ekaterina Vasilyeva, programming - Stanislav Vasilyev
Problem Source: The Xth Urals Collegiate Programing Championship, March 24-25, 2006