시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 339 91 38 22.754%

문제

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

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

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

입력

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

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

출력

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

예제 입력 1

3
100
90
200

예제 출력 1

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