시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 512 MB 9 9 9 100.000%

문제

Mahima has been experimenting with a new style of art. She stands in front of a canvas and, using her brush, flicks drops of paint onto the canvas. When she thinks she has created a masterpiece, she uses her 3D printer to print a frame to surround the canvas.

Your job is to help Mahima by determining the coordinates of the smallest possible rectangular frame such that each drop of paint lies inside the frame. Points on the frame are not considered inside the frame.

입력

The first line of input contains the number of drops of paint, N, where 2 ≤ N ≤ 100 and N is an integer. Each of the next N lines contain exactly two positive integers X and Y separated by one comma (no spaces). Each of these pairs of integers represents the coordinates of a drop of paint on the canvas. Assume that X < 100 and Y < 100, and that there will be at least two distinct points. The coordinates (0, 0) represent the bottom-left corner of the canvas.

출력

Output two lines. Each line must contain exactly two non-negative integers separated by a single comma (no spaces). The first line represents the coordinates of the bottom-left corner of the rectangular frame. The second line represents the coordinates of the top-right corner of the rectangular frame.

예제 입력 1

5
44,62
34,69
24,78
42,44
64,10

예제 출력 1

23,9
65,79

The bottom-left corner of the frame is (23, 9). Notice that if the bottom-left corner is moved up, the paint drop at (64, 10) will not be inside the frame. (See the diagram on the next page.) If the corner is moved right, the paint drop at (24, 78) will not be inside the frame. If the corner is moved down or left, then the frame will be larger and no longer the smallest rectangle containing all the drops of paint. A similar argument can be made regarding the top-right corner of the frame.