Rafi lives in a space. He wants to participate in the “Take-off Programming Contest Spring 2023” with a friend. Alas! He has no friends, and he feels lonely. So he thought to himself that he needed a friend in his life to fill this emptiness. But he only wants to be friends with someone who lives closest to his house.
Rafi came to you for help with this situation. Now you have to write a program to help him decide who will be his friend. Rafi himself lives in origin
The first line will be a single integer indicating the number of Rafi's neighbors. The following lines will contain two integers and and separated by a space. Where and are the positions of his neighbors' houses.
You have to print a line consisting of the coordinate as and separated by space which is the position of his new friend.
Check out the samples for clarification.
Input | Output |
---|---|
5 2 2 3 3 4 4 5 5 10 10 | 2 2 |
Input | Output |
---|---|
3 1 9 2 3 4 5 | 2 3 |
Rafi lives in the “Origin” coordinate of the space. (Look at the figure for better understanding). Distances for all the given test cases will be unique.
Formula of Distance Between Two coordinate is,
Be careful about the newline(‘\n’) at the end.