시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB117383140.260%

문제

In this task, you are provided with four sets of integers. Your task consists of selecting one integer from each set, such that their sum is 0. You can assume that exactly one such selection exists.

입력

The first line of input contains four numbers, a, b, c, and d, separated by a space character, indicating the number of elements in each of the four sets. Each of these numbers is a positive integer 1 ≤ a, b, c, d ≤ 500. The following a + b + c + d lines contain the elements, each not smaller than −60000 and not larger than 60000. The elements of the first set are listed first, followed by the elements of the second set, etc.

출력

The output consists of the four integers, separated by a space character. The numbers must appear in the order in which they are listed in the input file.

예제 입력 1

3 2 4 2
5
17
-8
-13
19
6
-9
10
0
-14
7

예제 출력 1

17 -13 10 -14

출처

Olympiad > National Olympiad in Informatics (Singapore) > NOI 2008 6번

  • 데이터를 추가한 사람: kyo20111