Problem:
Score : 400 points

Problem Statement

Fennec and Snuke are playing a board game.

On the board, there are N cells numbered 1 through N, and N-1 roads, each connecting two cells. Cell a_i is adjacent to Cell b_i through the i-th road. Every cell can be reached from every other cell by repeatedly traveling to an adjacent cell. In terms of graph theory, the graph formed by the cells and the roads is a tree.

Initially, Cell 1 is painted black, and Cell N is painted white. The other cells are not yet colored.
Fennec (who goes first) and Snuke (who goes second) alternately paint an uncolored cell.
More specifically, each player performs the following action in her/his turn:

Fennec: selects an uncolored cell that is adjacent to a black cell, and paints it black.

Snuke: selects an uncolored cell that is adjacent to a white cell, and paints it white.

A player loses when she/he cannot paint a cell. Determine the winner of the game when Fennec and Snuke play optimally.

Constraints

2 \leq N \leq 10^5

1 \leq a_i, b_i \leq N

The given 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

If Fennec wins, print Fennec; if Snuke wins, print Snuke.

Sample Input 1

7
3 6
1 2
3 1
7 4
5 7
1 4

Sample Output 1

Fennec

For example, if Fennec first paints Cell 2 black, she will win regardless of Snuke's moves.

Sample Input 2

4
1 4
4 2
2 3

Sample Output 2

Snuke

Solution in C# (Mono 4.6.2.0) (judge verdict: Time Limit Exceeded)

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

public class Program
{

	public void Proc()
	{
        int nodeCount = int.Parse(Reader.ReadLine());
        this.NodeList = new TreeNode[nodeCount];

        Dictionary<int, Dictionary<int, bool>> path = new Dictionary<int, Dictionary<int, bool>>();

        for (int i = 0; i < nodeCount; i++) {
            NodeList[i] = new TreeNode(i);
        }
        for (int i = 0; i < nodeCount - 1; i++) {
            int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)-1).ToArray();
            inpt.ToList().ForEach(a=>{
                if(!path.ContainsKey(a)) {
                    path.Add(a, new Dictionary<int, bool>());
                }
            });
            path[inpt[0]].Add(inpt[1], true);
            path[inpt[1]].Add(inpt[0], true);
        }
		Queue<int> que = new Queue<int>();
        path[0].ToList().ForEach(a =>
        {
            NodeList[0].AddItem(NodeList[a.Key]);
            que.Enqueue(a.Key);
        });
        while(que.Count()>0) {
            int current = que.Dequeue();
            path[current].ToList().ForEach(a =>
            {
                if(a.Key != NodeList[current].Parent.Id) {
                    NodeList[current].AddItem(NodeList[a.Key]);
                    que.Enqueue(a.Key);
                }
            });
        }
        int feneck = 0;
        int sunuke = (NodeList.Last().Depth - 1) / 2;
        TreeNode snukeRoot = NodeList.Last();
        for (int i = 0; i < sunuke; i++ ) {
            snukeRoot = snukeRoot.Parent;
        }
        sunuke = snukeRoot.GetSubNodeCount();
        feneck = nodeCount - 2 - sunuke;
        string ans = "Snuke";
        if (feneck>sunuke) {
            ans = "Fennec";
        }
        Console.WriteLine(ans);
    }

    private TreeNode[] NodeList;

    private class TreeNode
    {
        public int Id;

        public int Depth = 0;
        public TreeNode Parent;
        public List<TreeNode> Items = new List<TreeNode>();
        public TreeNode(int id)
        {
            this.Id = id;
        }
        public void AddItem(TreeNode child)
        {
            this.Items.Add(child);
            child.Parent = this;
            child.Depth = this.Depth + 1;
        }

        public int GetSubNodeCount() {
            if(this.Items.Count == 0) {
                return 0;
            }
            int ans = this.Items.Count;
            this.Items.ForEach(a=>{
                ans += a.GetSubNodeCount();
            });
            return ans;
        }
    }


    public class Reader
	{
		private static StringReader sr;
		public static bool IsDebug = false;
		public static string ReadLine()
		{
			if (IsDebug)
			{
				if (sr == null)
				{
					sr = new StringReader(InputText.Trim());
				}
				return sr.ReadLine();
			}
			else
			{
				return Console.ReadLine();
			}
		}
		private static string InputText = @"

5
1 5
5 3
3 2
4 1

";
	}

	public static void Main(string[] args)
	{
#if DEBUG
		Reader.IsDebug = true;
#endif
		Program prg = new Program();
		prg.Proc();
	}
}