One fine Sunday afternoon, a group of children headed by their mentor Pete came to the City's most famous museum.
Aunt Ipshi, who was a very kind and quiet person, worked at the ticket window on that day. Pete being a forgetful person , gave her the money but didn't specify the number of tickets to be bought. Could you help her determine the number of tickets Pete wanted knowing only the numbers of different notes he gave if it is guaranteed that the mentor didn't give extra notes, which means that there would not be enough money for the tickets if any of the notes was taken away.
Input
The first line contains six non- negative integers separated with a space; these are the numbers of 10, 50, 100, 500, 1000, and 5000 rupees notes Pete gave to Aunt Ipshi.
In the second line you are given the price of one ticket; it is a positive integer.
Output
Find the number of tickets Pete wanted to buy. Output the number of possible answers in the first line.
The variants in ascending order separated with a space must be given in the second line. It is guaranteed that there is at least one variant of the answer.
Constraints
0<=All Integers input<=1000