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 <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef pair<ll,P>  PP;
typedef vector<ll> Vector;
typedef vector<Vector> DVector;
typedef priority_queue<PP, vector<PP>, greater<PP>> PPQueue;

#define fi          first
#define se          second
#define sfi         se.fi
#define sse         se.se
#define pb          push_back
#define INF         INT_MAX
#define MOD         1000000007
#define bcnt        __builtin_popcount
#define all(x)      (x).begin(),(x).end()
#define uni(x)      x.erase(unique(all(x)),x.end())
#define ub(x,y)     (upper_bound(all(x),y)-x.begin())
#define lb(x,y)     (lower_bound(all(x),y)-x.begin())
#define rep(i,n)    repl(i,0,n-1)
#define usort(x)    sort(all(x))
#define dsort(x)    sort(all(x),greater<ll>())
#define mkp(x,y)    make_pair(x,y)
#define mmax(x,y)   (x>y?x:y)
#define mmin(x,y)   (x<y?x:y)
#define maxch(x,y)  x=mmax(x,y)
#define minch(x,y)  x=mmin(x,y)
#define exist(x,y)  (find(all(x),y)!=x.end())
#define each(itr,v) for(auto itr:v)
#define repl(i,a,b) for(ll i=(ll)(a);i<=(ll)(b);i++)
ll n;
DVector tree;
Vector snuke,fennec;

int main(){
  cin.sync_with_stdio(false);
  cin >> n;
  tree.resize(n);
  snuke.resize(n);
  fennec.resize(n);
  rep(i,n-1){
    ll a,b;
    cin >> a >> b;
    tree[a-1].pb(b-1);
    tree[b-1].pb(a-1);
  }
  queue<P> q1;
  q1.push(mkp(0,0));
  set<ll> st1;
  while(q1.size()){
    P state = q1.front();
    q1.pop();
    if(st1.count(state.fi))continue;
    st1.insert(state.fi);
    fennec[state.fi] = state.se;
    each(itr,tree[state.fi]){
      q1.push(mkp(itr,state.se+1));
    }
  }
  queue<P> q2;
  q2.push(mkp(n-1,0));
  set<ll> st2;
  while(q2.size()){
    P state = q2.front();
    q2.pop();
    if(st2.count(state.fi))continue;
    st2.insert(state.fi);
    snuke[state.fi] = state.se;
    each(itr,tree[state.fi]){
      q2.push(mkp(itr,state.se+1));
    }
  }
  ll cnt = 0;
  rep(i,n)cnt = fennec[i] <= snuke[i] ? cnt+1 : cnt-1;
  cout << (cnt >= 0 ? "Fennec" : "Sunuke") << endl;
}