Under construction

Still being built. Things may change

The Train at the End of the World

Time limit1sMemory limit1024 MB

Summary
Given N stations joined in a chain by straight tracks, print the coordinates of the lowest point (smallest y) on the railway.
Level

Easy2 of 10

Topics
Implementation, Geometry
Solved
No attempts yet

Statement

Southern Fuegian Railway is the southernmost railway in the world.

The Southern Fuegian Railway is drawn on a two-dimensional coordinate plane, where the positive direction of the xx-axis points east.

The Southern Fuegian Railway consists of NN stations and N−1N-1 tracks connecting them. The ii-th station is at (xi,yi)(x_i, y_i). The jj-th track is the line segment connecting station jj and station j+1j+1. (1≤i≤N;(1 \le i \le N; 1≤j≤N−1)1 \le j \le N-1)

Seon-a went to see the Southern Fuegian Railway and wondered where the southernmost point on the southernmost railway in the world is.

Input

The first line contains the number of stations NN. (1≤N≤1000)(1\le N\le 1000)

From the second line onward, NN lines follow. Each line contains two integers xix_i and yiy_i, separated by a space, which are the coordinates of a station. (∣xi∣,∣yi∣≤1000)(|x_i|,|y_i|\le 1000)

No two stations are at the same position.

Output

Print the xx and yy coordinates of the southernmost point on the Southern Fuegian Railway, separated by a space. Only inputs where this point is unique are given.

Examples1

  1. Example 1

    Input
    4
    10 5
    6 -3
    3 2
    4 2
    
    Expected output
    6 -3