Station

No attempts yetTime limit1sMemory limit128 MB

Problem

Byteotia's railway network consists of bidirectional track segments connecting railway stations. No two stations are directly connected by more than one segment, and every station is reachable from every other station along exactly one simple route. In other words, the network forms a tree.

The next stage of the reform organizes train lines around a single central station. Exactly one station is chosen to become a giant hub named Bitwise. For every other station, a line is set up that runs between Bitwise and that station along the unique route between them, stopping at every station in between. So there are n1n-1 lines in total.

Tickets are one-way and single-use. A single ticket lets a passenger ride one whole line (or any part of it), no matter how many track segments that line spans. The cost of traveling between two stations is therefore the minimum number of lines (tickets) a passenger must ride to get from one station to the other.

Choose which station becomes Bitwise so that the average travel cost, taken over all unordered pairs of two distinct stations, is as small as possible.

Input

The first line contains one integer nn (2n1,000,0002 \le n \le 1{,}000{,}000), the number of railway stations. Stations are numbered from 11 to nn. Each of the next n1n-1 lines describes one track segment with two integers aa and bb (1a<bn1 \le a < b \le n), meaning stations aa and bb are directly connected. The described network is a tree.

Output

Print a single integer: the number of the station that should become Bitwise, that is, a station that minimizes the average travel cost over all unordered pairs of distinct stations. If several stations attain this minimum, print the smallest such station number.

Hint

In the figure, circles are stations (the number inside each is its station number) and edges are track segments. Both station 77 and station 88 are optimal hubs; because ties are broken by choosing the smallest station number, the answer for this network is 77. With either of them as Bitwise, the average travel cost over all 2828 unordered pairs of distinct stations is 36281.2857\frac{36}{28} \approx 1.2857.