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: Accepted)

#include <bits/stdc++.h>
#define SORT(x) sort(x.begin(),x.end(),greater<int>())
#define ALL(x) x.begin(),x.end()
#define rep(i, n) for(int i = 0; i < n; i++)
#define reps(i, m, n) for(int i = m; i < n; i++)
#define repr(i, m, n) for(int i = m; i >= n; i--)
#define INF 1000000000000000003 //1000000007
#define PI (acos(-1))
#define MOD 1000000007
using namespace std;
typedef long long ll;

int x,y;
int ct1,ct2;
struct edge{ll to;}; //edgeパラメータ
struct graph{
  ll N; //ノードの個数
  vector<vector<edge> > G; //G[辺の元]((.to辺の先,.costコスト),...)
  vector<ll> parent;
  vector<ll> depth; // d[ノード] ノードの深さ

  graph(ll n){ //グラフ生成時
    N = n;
    G.resize(N); //Edge情報
    parent.resize(N); //Node情報,親
    depth.resize(N); //Node情報,深さ
    rep(i,N){depth[i]= -1; parent[i]= -1;}
  }
  void add_edge(ll s, ll t){
    G[s].emplace_back((edge){t});
  }

  void dfs(ll v=0, ll p=0, ll d=0){
    parent[v] = p;
    depth[v] = d;
    for(auto E : G[v]){ // E つなぐエッジ
      if(E.to != p) dfs(E.to , v , d+1); //まだ行ってないなら
    }
  }
  void dfs1(ll v=0, ll p=0, ll d=0){
    if(v==0) rep(i,N){parent[i] = -1;}
    parent[v] = p;
    depth[v] = d;
    //cout<< 1<< " "<<v<<"\n";
    ct1++;
    for(auto E : G[v]){ // E つなぐエッジ
      if(E.to != p and E.to !=x) dfs1(E.to , v , d+1); //まだ行ってないなら
    }
  }
  void dfs2(ll v, ll p, ll d=0){
    if(v==N-1) rep(i,N){parent[i] = -1;}
    parent[v] = p;
    depth[v] = d;
    //cout<< 2<< " "<<v<<"\n";
    ct2++;
    for(auto E : G[v]){ // E つなぐエッジ
      if(E.to != p and E.to !=y) dfs2(E.to , v , d+1); //まだ行ってないなら
    }
  }
};


void Main(){

  int N;
  cin>>N;

  graph g(N);
  //graph g2(N);

  rep(i,N-1){
    int a,b;
    cin>>a>>b;
    g.add_edge(a-1,b-1);
    g.add_edge(b-1,a-1);
    //g2.add_edge(a-1,b-1);
    //g2.add_edge(b-1,a-1);
  }

  g.dfs();
  //g2.dfs(N-1);
/*
  rep(i,N){
    if(g.depth[i]<=g2.depth[i])ct1++;
    else ct2++;
  }
*/


  int v=N-1;

  //cout<<g.depth[N-1] <<"\n";

  rep(i,(g.depth[N-1]-1)/2){
    v=g.parent[v];
  }
  x=v;
  y=g.parent[v];

  g.dfs1();
  g.dfs2(N-1,N-1);

  //cout<< x<<"\n";
  //cout<< y<<"\n";

  //cout<< ct1<<"\n";
  //cout<< ct2<<"\n";


  cout<< ( ct1>ct2 ? "Fennec" : "Snuke" )<<"\n";
}

//-----------------------------------
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
}
//-----------------------------------