CD#1266

CD

1 second
122.812 megabytes
Very easy

You have a long car journey ahead. You have a tape recorder, but unfortunately your favorite music is only on CDs. In order to listen to it in the car, you need to record it onto a tape. You have a tape of minutes in length. How should you select tracks from the CD to make the best use of the tape's capacity, minimizing the unused space?

Assumptions:

The program should find a set of tracks that fills the tape as much as possible and print the chosen track durations in the same order as they appear on the CD.

Input

The input consists of multiple lines. Each line contains the value , followed by the number of tracks, then the durations of each track. All values are separated by spaces. For example, in the first line of the sample data: N = 5, number of tracks s = 3, first track lasts minute, second minutes, and the last minutes.

Output

Output the durations of the selected tracks in the order they appear on the CD on a single line. Then, on the next line, output the string sum: and the sum of their durations.

Examples

Example 1

Loading
Loading