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)

#include <cstring>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

ll n;
const int MAX_V = half_inf;
vector<int> G[MAX_V];
vector<bool> f_seen, s_seen;


queue<int> s_bfs(queue<int> q_v) {
    queue<int> next_v;
    while (!q_v.empty()) {
        int v = q_v.front();
        q_v.pop();
        rep(i, G[v].size()) {
            if (!f_seen[G[v][i]] && !s_seen[G[v][i]]) {
                next_v.push(G[v][i]);
                s_seen[G[v][i]] = true;
            }
        }
    }
    return next_v;
}

queue<int> f_bfs(queue<int> q_v) {
    queue<int> next_v;
    while (!q_v.empty()) {
        int v = q_v.front();
        q_v.pop();
        rep(i, G[v].size()) {
            if (!s_seen[G[v][i]] && !f_seen[G[v][i]]) {
                next_v.push(G[v][i]);
                f_seen[G[v][i]] = true;
            }
        }
    }
    return next_v;
}

void solve() {
    queue<int> q_f, q_s;
    q_f.push(0), q_s.push(n - 2);
    f_seen[0] = true, s_seen[n - 2] = true;
    int f_num = 1, s_num = 1;
    while (true) {
        q_f = f_bfs(q_f);
        f_num += q_f.size();
        q_s = s_bfs(q_s);
        s_num += q_s.size();
        if (q_f.empty() && q_s.empty()) {
            if (f_num > s_num) {
                cout << "Fennec" << endl;
                return;
            } else {
                cout << "Snuke" << endl;
                return;
            }
        }
    }
}

int main() {
    cin >> n;
    for (int i = 0; i < n - 1; ++i) {
        int s, t;
        scanf("%d %d", &s, &t);
        s--, t--;
        G[s].push_back(t);
        G[t].push_back(s);
    }
    f_seen.resize(n), s_seen.resize(n);
    fill(f_seen.begin(), f_seen.end(), false), fill(s_seen.begin(), s_seen.end(), false);
    solve();
    return 0;
}