atcoder#AGC033C. [AGC033C] Removing Coins

[AGC033C] Removing Coins

Score : 800800 points

Problem Statement

Takahashi and Aoki will play a game on a tree. The tree has NN vertices numbered 11 to NN, and the ii-th of the N1N-1 edges connects Vertex aia_i and Vertex bib_i.

At the beginning of the game, each vertex contains a coin. Starting from Takahashi, he and Aoki will alternately perform the following operation:

  • Choose a vertex vv that contains one or more coins, and remove all the coins from vv.
  • Then, move each coin remaining on the tree to the vertex that is nearest to vv among the adjacent vertices of the coin's current vertex.

The player who becomes unable to play, loses the game. That is, the player who takes his turn when there is no coin remaining on the tree, loses the game. Determine the winner of the game when both players play optimally.

Constraints

  • 1N2×1051 \leq N \leq 2 \times 10^5
  • 1ai,biN1 \leq a_i, b_i \leq N
  • aibia_i \neq b_i
  • The graph given as input is a tree.

Input

Input is given from Standard Input in the following format:

NN

a1a_1 b1b_1

a2a_2 b2b_2

::

aN1a_{N-1} bN1b_{N-1}

Output

Print First if Takahashi will win, and print Second if Aoki will win.

3
1 2
2 3
First

Here is one possible progress of the game:

  • Takahashi removes the coin from Vertex 11. Now, Vertex 11 and Vertex 22 contain one coin each.
  • Aoki removes the coin from Vertex 22. Now, Vertex 22 contains one coin.
  • Takahashi removes the coin from Vertex 22. Now, there is no coin remaining on the tree.
  • Aoki takes his turn when there is no coin on the tree and loses.
6
1 2
2 3
2 4
4 6
5 6
Second
7
1 7
7 4
3 4
7 5
6 3
2 1
First