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++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

/*
これを入れて実行
g++ code.cpp
./a.out
 */
 
#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <unordered_map>
#include <cmath>
#include <math.h>
#include <tuple>
#include <iomanip>
#include <bitset>
#include <functional>

#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
using namespace std;
typedef long long ll;
typedef long double ld;
 
int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
 
const long long INF = 1LL << 62;
const ll MOD = 1e9 + 7;
 
bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}
 
ll gcd(ll a, ll b){
	if (b == 0)return a;
	return gcd(b, a % b);
}
 
ll lcm(ll a, ll b){
    return a / gcd(a, b) * b;
}
 
ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}
 
ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}
 
//-----------------------ここから-----------
int n;
vector<vector<int>> g;
vector<int> r;
int dfs(int now, int pa, vector<int> &num, int op){
    int res = 0;
    rep(i, g[now].size()){
        int next = g[now][i];
        if(next == pa) continue;
        if(next == op) continue;
        res += dfs(next, now, num, op);
    }
    return num[now] = res + 1;
}
void dfs2(int now, int pa, vector<int> &route){
    route.push_back(now);
    if(now == n - 1){
        r = route;
        return;
    }
    rep(i, g[now].size()){
        int next = g[now][i];
        if(next == pa) continue;
        dfs2(next, now, route);
    }
    route.pop_back();
}
int main(void){
    cin >> n;
    g.resize(n);
    rep(i, n - 1){
        int a, b;
        cin >> a >> b;
        a--;
        b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    vector<int> fnum(n, 0);
    vector<int> snum(n, 0);
    dfs(0, -1, fnum, n - 1);
    dfs(n - 1, -1, snum, 0);
    vector<int> dr;
    dfs2(0, -1, dr);

    int f = 0;
    int s = r.size() - 1;
    int fennec = fnum[0];
    int snuke = snum[n - 1];
    int start = 0;
    while(abs(s - f) > 1){
        f++;
        fennec += fnum[r[f]];
        if(f == s - 1){
            start = 1;
            break;
        }
        s--;
        snuke += snum[r[s]];
        if(f + 1 == s){
            start = 0;
            break;
        }
    }

    //cout << snuke << " " << fennec << endl;
    if(start){
        if(snuke > fennec){
            cout << "Snuke" << endl;
        } else {
            cout << "Fennec" << endl;
        }
    } else {
        if(fennec > snuke){
            cout << "Fennec" << endl;
        } else {
            cout << "Snuke" << endl;
        }
    }
}