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 C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define rep(i, n) FOR(i, 0, n)
#define rep1(i, n) FOR(i, 1, int(n) + 1)
#define rrep(i, n) RFOR(i, 0, n)
#define rrep1(i, n) RFOR(i, 1, int(n) + 1)
#define all(c) begin(c), end(c)
const int MOD = 1000000007;

template <typename T>
void __dump__(std::ostream &os, const T &first) {
    os << first;
}
template <typename First, typename... Rest>
void __dump__(std::ostream &os, const First &first, const Rest &... rest) {
    os << first << ", ";
    __dump__(os, rest...);
}

#ifdef LOCAL
#define dump(...)                                         \
    do {                                                  \
        std::ostringstream os;                            \
        os << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; \
        __dump__(os, __VA_ARGS__);                        \
        std::cerr << os.str() << std::endl;               \
    } while (0)
#else
#define dump(...)
#endif

int n;
vector<vector<int>> g;

vector<int> deg;
vector<int> adj_deg1;
vector<int> adj_deg2;

bool two_any_path_two(int, int);
bool two_any_path_any(int, int);

vector<int> dp1;
bool two_any_path_any(int v, int p) {
    dump(v, p);
    int &res = dp1[v];
    if (res != -1) return res;

    res = false;
    for (auto &c : g[v]) {
        if (c == p) continue;
        if (deg[c] == 2) {
            res |= two_any_path_two(c, v);
        }
    }
    return res;
}

vector<int> dp2;
bool two_any_path_two(int v, int p) {
    dump(v, p);
    int &res = dp2[v];
    if (res != -1) return res;

    res = false;
    if (deg[v] == 1) res = true;
    for (auto &c : g[v]) {
        if (c == p) continue;
        if (adj_deg2[c] >= 2) {
            res |= two_any_path_any(c, v);
        }
    }
    return res;
}

bool dfs(int v, int p) {
    dump(v, p);
    int cnt = 0;
    for (auto &c : g[v]) {
        if (c == p) continue;
        if (two_any_path_two(c, v)) ++cnt;
        if (dfs(c, v)) return true;
    }
    return cnt >= 2;
}

bool solve() {
    if (n == 2) {
        return false;
    }
    adj_deg1.assign(n, 0);
    adj_deg2.assign(n, 0);
    rep(i, n) {
        if (deg[i] == 1) {
            for (auto &j : g[i]) adj_deg1[j]++;
        }
        if (deg[i] == 2) {
            for (auto &j : g[i]) adj_deg2[j]++;
        }
    }
    dp1.assign(n, -1);
    dp2.assign(n, -1);
    rep(i, n) {
        if (deg[i] >= 2) {
            return dfs(i, -1);
        }
    }
    assert(false);

    // bool w_win = false;
    // rep(i, n) {
    //     if (deg[i] == 2) {
    //         int c = 0;
    //         for (auto &j : g[i]) {
    //             if (adj_deg1[j]) {
    //                 ++c;
    //             }
    //         }
    //         if (c >= 2) {
    //             w_win = true;
    //         }
    //     }

    //     int leaf = 0;
    //     for (auto &j : g[i]) {
    //         if (deg[j] == 1) leaf++;
    //     }
    //     if (leaf >= 2) {
    //         w_win = true;
    //     }
    // }
    // return w_win;
}

int main() {
    while (cin >> n) {
        g.assign(n, {});
        deg.assign(n, 0);
        rep(i, n - 1) {
            int a, b;
            cin >> a >> b;
            --a; --b;
            g[a].push_back(b);
            g[b].push_back(a);
            ++deg[a];
            ++deg[b];
        }
        //if (w_win) abort();
        cout << (solve() ? "First" : "Second") << endl;
    }
}