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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
        private static int iFen;
        private static int iSnk;

    static void Main(string[] args)
    {
            // 入力
            string[] sS = Console.ReadLine().Trim().Split(' ');
            int iN = int.Parse(sS[0]);
            List<int> lstBace = new List<int>();                                            // 拠点
            List<List<int>> lstForB = new List<List<int>>();                                // 拠点の相手経路
            for (int i = 0; i < iN; i++) { lstBace.Add(-1); lstForB.Add(new List<int>()); } // IndexNoが拠点No 値は -1:未定 0:? 1:Fennec 2:Snuke
            //List<ClsAtoB> lstRute = new List<ClsAtoB>();                                  // 経路
            for (int i = 0; i < iN - 1; i++)
            {
                sS = Console.ReadLine().Trim().Split(' ');
                int ia = int.Parse(sS[0]) - 1;
                int ib = int.Parse(sS[1]) - 1;
                //lstRute.Add(new ClsAtoB() { iA = ia, iB = ib, });                         // 拠点Noは0始まり
                //lstRute.Add(new ClsAtoB() { iA = ib, iB = ia, });                         // 拠点Noは0始まり 経路情報は相互で保持
                lstForB[ia].Add(ib);                                                        // iaからib
                lstForB[ib].Add(ia);                                                        // ibからia
            }

            System.Diagnostics.Stopwatch sw = new System.Diagnostics.Stopwatch();
            sw.Start();

            // 解析
            iFen = 0;
            iSnk = iN - 1;
            //lstRute.Sort(delegate (ClsAtoB mca1, ClsAtoB mca2) { return (int)(mca1.iA - mca2.iA) == 0 ? (mca1.iB - mca2.iB) : (mca1.iA - mca2.iA); });      // iAの昇順 の iBの昇順
            //GetForB(lstForB, lstRute);                                                    // 拠点の相手経路判別
            lstBace[iFen] = 1;                                                              // Fennecの拠点
            lstBace[iSnk] = 2;                                                              // Snuke の拠点
            int iFenCnt = 0;                                                                // Fennecの領土の数
            int iSnkCnt = 0;                                                                // Snuke の領土の数
            for (int i = 1; i < lstBace.Count - 1; i++)                                     // 拠点
            {
                lstBace[i] = GetArea(i, lstForB);                                           // 領土判別
                if (lstBace[i] == 0 || lstBace[i] == 1) { iFenCnt += 1; }
                if (lstBace[i] == 2)                    { iSnkCnt += 1; }
            }
            string sOut = "Snuke";
            if (iFenCnt >= iSnkCnt) { sOut = "Fennec"; }

            //出力
            Console.WriteLine("{0}", sOut.ToString().Trim());

            sw.Stop();
#if DEBUG
            Console.WriteLine();
            Console.WriteLine("{0}", sw.Elapsed.ToString());
            Console.WriteLine("続行するには何かキーを押してください．．．");
            Console.ReadKey();
#endif
    }

        // 領土確認
        private static int GetArea(int iBs, List<List<int>> lstForB)
        {
            int iRet = -1;
            List<int> lstTemp = lstForB[iBs];               // iBsからの先一覧

            Boolean bFen = false;
            Boolean bSnk = false;
            for (int i = 0; i < lstTemp.Count; i++)         // iBsからの先一覧
            {
                if (lstTemp[i] == iFen) { bFen = true; }    // 次にFennecの場合
                if (lstTemp[i] == iSnk) { bSnk = true; }    // 次にSnuke の場合
            }
            if (bFen && bSnk) { iRet = 0; }                 // 境界
            else if (bFen) { iRet = 1; }                    // Fennecの領土
            else if (bSnk) { iRet = 2; }                    // Snuke の領土
            else
            {
                for (int i = 0; i < lstTemp.Count; i++)     // iBsからの先一覧
                {
                    iRet = GetArea(lstTemp[i], lstForB);    // 領土判別
                    if (iRet != -1) { break; }              // 領土判別したら抜ける
                }
            }
            return iRet;
        }

        // 拠点の相手経路判別
        private static void GetForB(List<List<int>> lstForB, List<ClsAtoB> lstRute)
        {
            for (int i = iFen; i <= iSnk; i++)                                              // 10万
            {
                List<int> oneUsr = new List<int>();
                for (int j = 0; j < lstRute.Count; j++)                                     // 20万
                {
                    if (lstRute[j].iA == i) { oneUsr.Add(lstRute[i].iB); }
                }
                lstForB.Add(oneUsr);
            }
        }

        private class ClsAtoB                   // 経路用
        {
            public int iA { get; set; } = 0;
            public int iB { get; set; } = 0;
        }

}