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# (Mono 4.6.2.0) (judge verdict: Accepted)

//#pragma warning disable

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;

public class Test
{
    public class Tree
    {
        public Node Root;
        public Node[] Leaves;  // 注意：根はLeavesに含まれません

        public Tree(IEnumerable<long>[] adjacency_list)
        {
            Root = Node.FromAdjacencyList(adjacency_list, 0, null);

            Leaves = SearchLeaves(Root).ToArray();
        }

        private IEnumerable<Node> SearchLeaves(Node v)
        {
            if (v.Children.Length == 0)
            {
                return new[] { v };
            }

            var ret = new List<Node>();

            foreach (var c in v.Children)
            {
                ret.AddRange(SearchLeaves(c));
            }

            return ret;
        }

        public class Node
        {
            public Node Parent;
            public Node[] Children;
            public long Id;
            public int Degree { get { return Children.Length; } }

            public Node(Node parent, Node[] children, long id) { Parent = parent; Children = children; Id = id; }

            public override string ToString()
            {
                return Id + (Children.Length == 0 ? "" : "[" + string.Join(",", Children.Select(x => x.ToString())) + "]");
            }

            public static Node FromAdjacencyList(IEnumerable<long>[] adjacency_list, long rootIndex = 0, long? parentIndex = null)
            {
                var arr = (adjacency_list[rootIndex] as long[]) ?? adjacency_list[rootIndex].ToArray();

                var children = arr.Where(x => x != parentIndex).Select(x => FromAdjacencyList(adjacency_list, x, rootIndex)).ToArray();

                var root = new Node(null, children, rootIndex);

                foreach (var c in children)
                {
                    c.Parent = root;
                }

                return root;
            }
        }

        public override string ToString()
        {
            return Root.ToString();
        }
    }

    public static void Main()
    {
        var N = long.Parse(Console.ReadLine());

        var adj = new List<long>[N];
        for (int i = 0; i < N; i++)
        {
            adj[i] = new List<long>();
        }

        for (var i = 0; i < N - 1; i++)
        {
            var line1 = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();

            adj[line1[0] - 1].Add(line1[1] - 1);
            adj[line1[1] - 1].Add(line1[0] - 1);
        }

        var tree = new Tree(adj);
        //Console.WriteLine(new Tree(adj).ToString());
        //Console.WriteLine(String.Join(",", new Tree(adj).Leaves.Select(x => x.Id)));

        var q = new Queue<Tree.Node>();
        foreach (var v in tree.Leaves)
        {
            q.Enqueue(v);
        }

        while (q.Count != 0)
        {
            var next = q.Dequeue();

            if (next.Parent == null)
            {
                // 根の子が0個
                Console.WriteLine("First");
                return;
            }

            if (next.Parent.Degree == 1)
            {
                if (next.Parent.Parent == null)
                {
                    // 全消し
                    Console.WriteLine("Second");
                    return;
                }

                // next と next.Parent のノードを除去
                next.Parent.Parent.Children = next.Parent.Parent.Children.Where(x => x != next.Parent).ToArray();
                if (next.Parent.Parent.Degree == 0)
                {
                    q.Enqueue(next.Parent.Parent);
                }
            }
            else
            {
                if (next.Parent.Children.All(x => x.Degree == 0))
                {
                    // next.Parentの子供が2個以上あり、全部 葉
                    Console.WriteLine("First");
                    return;
                }
                else
                {
                    // 後回し
                    q.Enqueue(next);
                }
            }
        }
    }
}