Your local gym has n barbells and m plates. In order to prepare a weight for lifting, you must choose a single barbell, which has two sides. You then load each side with a (possibly empty) set of plates. For safety reasons, the plates on each side must sum to the same weight. What weights are available for lifting?
The first line contains the integers n and m (1≤n,m≤14).
The second line contains n integers b1,...,bn (1≤bi≤108), denoting the weights of the barbells in grams.
The third line contains m integers p1,...,pm (1≤pi≤108), denoting the weights of the plates in grams.
Print a sorted list of all possible distinct weights in grams, one per line.
For example, suppose that there are two barbells weighing 100 and 110 grams, and five plates weighting 1,4,5,5 and 6 grams, respectively. Then, there are six possible weights available for lifting.