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 itemCount = int.Parse(Reader.ReadLine());
        this.NodeList = new TreeNode[itemCount];
        for (int i = 0; i < itemCount - 1; i++) {
            int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)-1).ToArray();
            inpt.ToList().ForEach(a=>{
                if(!RoadDic.ContainsKey(a)) {
                    RoadDic.Add(a, new List<int>());
                }
            });
            RoadDic[inpt[0]].Add(inpt[1]);
            RoadDic[inpt[1]].Add(inpt[0]);
        }
        NodeList[0] = new TreeNode(0);
        RoadDic[0].ForEach(a =>
        {
            NodeList[a] = new TreeNode(a);
            NodeList[0].AddItem(NodeList[a]);
            BuildTree(NodeList[a]);
        });
        int sunukeMinDepth = this.NodeList[itemCount - 1].Depth - (this.NodeList[itemCount - 1].Depth - 1) / 2;
        TreeNode sunukeRoot = this.NodeList[itemCount - 1];
        while(sunukeRoot.Depth != sunukeMinDepth) {
            sunukeRoot = sunukeRoot.Parent;
        }
        int sunukeCount = sunukeRoot.SubNodesCount + 1;
        int fenecCount = itemCount - sunukeCount;
        string ans = "Fennec";
        if (sunukeCount >= fenecCount) {
            ans = "Snuke";
        }
        Console.WriteLine(ans);
    }

    private void BuildTree(TreeNode current) {
        if(!RoadDic.ContainsKey(current.ID)) {
            return;
        }
        foreach(int key in this.RoadDic[current.ID]) {
            if(key == current.Parent.ID) {
                continue;
            }
            NodeList[key] = new TreeNode(key);
            current.AddItem(NodeList[key]);
            BuildTree(NodeList[key]);
        }
    }


    private TreeNode[] NodeList;

    private Dictionary<int, List<int>> RoadDic = new Dictionary<int, List<int>>();

    private class TreeNode {
        public int ID;
        public int Depth;
        public TreeNode Parent;
        public List<TreeNode> Items = new List<TreeNode>();
        public TreeNode(int id) {
            this.ID = id;
        }
        private Nullable<int> SubNodesCountValue = null;
        public int SubNodesCount {
            get{
                if(SubNodesCountValue == null) {
                    if(this.Items.Count == 0) {
                        this.SubNodesCountValue = 0;
                    } else {
                        this.SubNodesCountValue = this.Items.Select(a => a.SubNodesCount + 1).Sum();
                    }
                }
				return this.SubNodesCountValue.Value;
			}
        }
        public void AddItem(TreeNode item) {
            this.Items.Add(item);
            item.Parent = this;
            item.Depth = this.Depth + 1;
        }
    }


	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 = @"
 


4
1 4
4 2
2 3


";
	}

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