A city is hosting an annual storytelling festival. Olena, a talented storyteller, wants to participate in the competition. The festival lasts several evenings, and each evening is dedicated to exactly hours of performances.
Olena knows many interesting stories of various durations. She wants to tell as many stories as possible to impress the jury and audience.
Festival rules:
Each story must be started in the evening and may continue into the next evening.
Stories must not be repeated.
Except for the last story, all others must either finish by the end of the evening or continue to the next evening.
The more stories Olena tells, the more points she receives from the jury. Help Olena choose an optimal strategy to maximize the number of stories told.
The first line contains an integer (1 \leq N \leq 10000) — the number of stories Olena knows. The second line contains natural numbers, each not exceeding , representing the duration of each story in hours. It is assumed that each evening lasts hours.
Print in the first line the maximum number of stories Olena can tell, and in the second line their durations in the order she should tell them.
Example 1