시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 325 87 34 21.935%

문제

학생회장을 하고 있는 상근이는 이번 학교 축제 행사로 학우들간의 친밀감을 돈독히 하고자 줄다리기를 하려 한다.

하지만 이 줄다리기에 형평성을 최대한 고려하기위해 두 팀간의 사람 수 차이를 1 이하로 하려하며, 두 팀간의 몸무게의 차이가 최소화되도록 하고자 한다.

이때 상근이가 나누려 하는 두 팀의 몸무게를 각각 출력 하시오.

입력

가장 첫번째 줄에 줄다리기를 하기 원하는 총 인원의 수(1 ≤ N ≤ 100)가 주어진다.

이후 N개의 줄에 줄다라기에 참여하기 원하는 사람의 몸무게(1 ≤ K ≤ 450)가 주어진다.

출력

두팀의 몸무게를 작은 순서대로 순차적으로 출력한다.

예제 입력 1

3
100
90
200

예제 출력 1

190 200
W3sicHJvYmxlbV9pZCI6IjQzODQiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWFjZjVcdWQzYzlcdWQ1NThcdWFjOGMgXHVkMzAwIFx1YjA5OFx1YjIwNFx1YWUzMCIsImRlc2NyaXB0aW9uIjoiPHA+XHVkNTU5XHVjMGRkXHVkNjhjXHVjN2E1XHVjNzQ0IFx1ZDU1OFx1YWNlMCBcdWM3ODhcdWIyOTQgXHVjMGMxXHVhZGZjXHVjNzc0XHViMjk0IFx1Yzc3NFx1YmM4OCBcdWQ1NTlcdWFkNTAgXHVjZDk1XHVjODFjIFx1ZDU4OVx1YzBhY1x1Yjg1YyBcdWQ1NTlcdWM2YjBcdWI0ZTRcdWFjMDRcdWM3NTggXHVjZTVjXHViYzAwXHVhYzEwXHVjNzQ0IFx1YjNjOFx1YjNjNVx1ZDc4OCBcdWQ1NThcdWFjZTBcdWM3OTAgXHVjOTA0XHViMmU0XHViOWFjXHVhZTMwXHViOTdjIFx1ZDU1OFx1YjgyNCBcdWQ1NWNcdWIyZTQuPFwvcD5cclxuXHJcbjxwPlx1ZDU1OFx1YzljMFx1YjljYyBcdWM3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