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: Wrong Answer)

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

namespace Codeforces
{
	internal class Template
	{
		private HashSet<int>[] adj = new HashSet<int>[100010];
		private HashSet<int>[] orig = new HashSet<int>[100010];
		private int[] color;

		private void Solve()
		{
			var n = cin.NextInt();
			color = new int[n + 1];
			for (var i = 1; i <= n; i++)
			{
				adj[i] = new HashSet<int>();
			}
			for (var i = 0; i < n - 1; i++)
			{
				var a = cin.NextInt();
				var b = cin.NextInt();
				adj[a].Add(b);
				adj[b].Add(a);
			}
			for (var i = 1; i <= n; i++)
			{
				orig[i] = new HashSet<int>(adj[i]);
			}
			var leaves = new List<int>();
			for (var i = 1; i <= n; i++)
			{
				if (adj[i].Count == 1)
				{
					leaves.Add(i);
				}
			}
			for (var i = 0; i < leaves.Count; i++)
			{
				var idx = leaves[i];
				if (adj[idx].Count == 0)
				{
					color[idx] = 1;
					break;
				}
				if(adj[idx].Count != 1) throw new AccessViolationException();
				color[idx] = 2;
				var next = adj[idx].Single();
				if (color[next] == 1)
				{
					Console.WriteLine("First");
					return;
				}
				color[next] = 1;
				adj[next].Remove(idx);
				if (adj[next].Count == 1 && color[adj[next].Single()] == 0)
				{
					leaves.Add(next);
				}
			}
			var res = Dfs(1, -1);
			var output = res ? "First" : "Second";
			Console.WriteLine(output);
		}

		private bool Dfs(int u, int p)
		{
			if (color[u] == 1)
			{
				var hasBlack = false;
				foreach (var v in orig[u])
				{
					if (color[v] == 2)
					{
						hasBlack = true;
						break;
					}
				}
				if (!hasBlack)
				{
					return true;
				}
			}
			foreach (var v in orig[u])
			{
				if (v != p)
				{
					if (Dfs(v, u))
					{
						return true;
					}
				}
			}
			return false;
		}

		private static readonly Scanner cin = new Scanner();

		private static void Main()
		{
#if DEBUG
			var inputText = File.ReadAllText(@"..\..\input.txt");
			var testCases = inputText.Split(new[] { "input" }, StringSplitOptions.RemoveEmptyEntries);
			var consoleOut = Console.Out;
			for (var i = 0; i < testCases.Length; i++)
			{
				var parts = testCases[i].Split(new[] { "output" }, StringSplitOptions.RemoveEmptyEntries);
				Console.SetIn(new StringReader(parts[0].Trim()));
				var stringWriter = new StringWriter();
				Console.SetOut(stringWriter);
				var sw = Stopwatch.StartNew();
				new Template().Solve();
				sw.Stop();
				var output = stringWriter.ToString();

				Console.SetOut(consoleOut);
				var color = ConsoleColor.Green;
				var status = "Passed";
				if (parts[1].Trim() != output.Trim())
				{
					color = ConsoleColor.Red;
					status = "Failed";
				}
				Console.ForegroundColor = color;
				Console.WriteLine("Test {0} {1} in {2}ms", i + 1, status, sw.ElapsedMilliseconds);
			}
			Console.ReadLine();
			Console.ReadKey();
#else
			new Template().Solve();
			Console.ReadLine();
#endif
		}
	}

	internal class Scanner
	{
		private string[] s = new string[0];
		private int i;
		private readonly char[] cs = { ' ' };

		public string NextString()
		{
			if (i < s.Length) return s[i++];
			var line = Console.ReadLine() ?? string.Empty;
			s = line.Split(cs, StringSplitOptions.RemoveEmptyEntries);
			i = 1;
			return s.First();
		}

		public double NextDouble()
		{
			return double.Parse(NextString());
		}

		public int NextInt()
		{
			return int.Parse(NextString());
		}

		public long NextLong()
		{
			return long.Parse(NextString());
		}
	}
}