K Smallest Sums#2057

K Smallest Sums

1 second
64 megabytes
Very easy

You are given arrays, each containing integers. There are k^k ways to choose exactly one element from each array and calculate their sum. Your task is to find the smallest sums among these possible sums.

Input

The input consists of several test cases. The first line of each test case contains an integer (2 \leq k \leq 750). Each of the following lines contains positive integers describing one array. Each integer does not exceed .

Output

For each test case, print the smallest sums in ascending order, one per line.

Examples

Example 1

Loading
Loading