Problem:
Score : 900 points

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.

Sample Input 1

3
1 2
2 3

Sample 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.

Sample Input 2

4
1 2
2 3
2 4

Sample Output 2

First

Sample Input 3

6
1 2
2 3
3 4
2 5
5 6

Sample Output 3

Second

Solution in Rust (1.15.1) (judge verdict: Accepted)

use std::io::Read;
use std::collections::HashMap;

fn check(cnt: [usize; 3]) -> usize {
    if cnt[2] > 0 || cnt[1] >= 2 { 2 }
    else if cnt[1] == 0 { 1 }
    else { 0 }
}

#[derive(Default)]
struct Solver {
    all : HashMap<usize, [usize; 3]>,
    part : HashMap<(usize, usize), usize>
}

impl Solver {
    fn solve_impl(&mut self, g: &Vec<Vec<usize>>, pos: usize, prev: usize) -> usize {
        let n = g.len();
        if self.part.contains_key(&(pos, prev)) { return self.part[&(pos, prev)]; }
        if prev != n && self.all.contains_key(&pos){
            let mut cnt = self.all[&pos];
            cnt[self.solve_impl(g, prev, pos)] -= 1;
            let res = check(cnt);
            self.part.insert((pos, prev), res);
            return res;
        }
        let mut cnt = [0; 3];
        for &next in &g[pos] {
            if next == prev { continue; }
            cnt[self.solve_impl(g, next, pos)] += 1;
        }
        let res = check(cnt);
        if prev == n { self.all.insert(pos, cnt); }
        self.part.insert((pos, prev), res);
        res
    }

    pub fn solve(&mut self, g: &Vec<Vec<usize>>) -> bool {
        let n = g.len();
        for i in 0..n {
            if self.solve_impl(g, i, n) == 2 { return true; }
        }
        false
    }
}

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).ok();
    let mut it = buf.split_whitespace();
    let n = it.next().unwrap().parse::<usize>().unwrap();
    let mut g = vec![Vec::<usize>::new(); n];
    for _ in 0..n-1 {
        let a = it.next().unwrap().parse::<usize>().unwrap() - 1;
        let b = it.next().unwrap().parse::<usize>().unwrap() - 1;
        g[a].push(b);
        g[b].push(a);
    }
    let mut s = Solver::default();
    println!("{}", if s.solve(&g) { "First" } else { "Second" });
}