AtCoder Grand Contest 014
D
Black and White Tree
AtCoder
⌀ 2266
原题
← CE →
翻译中…

Problem Statement

翻译中…

There is a tree with $N$ vertices numbered $1$ through $N$. The $i$-th of the $N-1$ edges connects vertices $a_i$ and $b_i$.

翻译中…

Initially, each vertex is uncolored.

翻译中…

Takahashi and Aoki is playing a game by painting the vertices. In this game, they alternately perform the following operation, starting from Takahashi:

翻译中…
  • Select a vertex that is not painted yet.
  • If it is Takahashi who is performing this operation, paint the vertex white; paint it black if it is Aoki.
翻译中…

Then, after all the vertices are colored, the following procedure takes place:

翻译中…
  • Repaint every white vertex that is adjacent to a black vertex, in black.
翻译中…

Note that all such white vertices are repainted simultaneously, not one at a time.

翻译中…

If there are still one or more white vertices remaining, Takahashi wins; if all the vertices are now black, Aoki wins. Determine the winner of the game, assuming that both persons play optimally.

翻译中…

Constraints

翻译中…
  • $2 ≤ N ≤ 10^5$
  • $1 ≤ a_i,b_i ≤ N$
  • $a_i ≠ b_i$
  • The input graph is a tree.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N
a_1 b_1
:
a_{N-1} b_{N-1}

翻译中…

Output

翻译中…

Print First if Takahashi wins; print Second if Aoki wins.

翻译中…

样例

Input #1
3
1 2
2 3
Output #1
First
Below is a possible progress of the game: - First, Takahashi paint vertex $2$ white. - Then, Aoki paint vertex $1$ black. - Lastly, Takahashi paint vertex $3$ white. In this case, the colors of vertices $1$, $2$ and $3$ after the final procedure are black, black and white, resulting in Takahashi's victory.
Input #2
4
1 2
2 3
2 4
Output #2
First
Input #3
6
1 2
2 3
3 4
2 5
5 6
Output #3
Second
题目信息
题号
agc014_d
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。