Language: C++

#include <bits/stdc++.h>
//#include <mylib.h>
using namespace std;
//cin.sync_with_stdio(false);

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define FOR_EQ(i,a,b) for(int i = (a); i <= (b); ++i)
#define FOR_RE(i,a,b) for(int i = (a); i > (b); --i)
#define rep(i,n) FOR(i,0,n)
#define rep_eq(i,n) FOR_EQ(i,0,n)
#define rep_re(i,n) FOR_RE(i,n,0)

#define DEBUG_VARIABLE(variable) cout << #variable << ":" << variable << endl

#define WHITE 1//（未訪問）
#define GRAY 2//（訪問）未だに訪問していない頂点への辺を持っている。スタックに退避。
#define BLACK 3//（訪問完了）未訪問への頂点への辺を持たない
#define N 100000
#define INFTY (1 << 21) //10^21
int M[N][N];//隣接行列
int color[N];

//1個上から時計周り
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
//上右下左
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {-1, 0, 1, 0};
static const int NIL = -1;

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> Vector;
typedef vector<Vector>	DVector;
int n;

void printArray(int *array, int);
void printDimention(DVector);

int dis_F[N];
int dis_S[N];
int dis = -1;

void dfs_visit(int u, bool flg){
    int v;
    dis++;
    //探索中、未探索の辺を持つ
    color[u] = GRAY;
    if(flg){
        dis_F[u] = dis;
    }else{
        dis_S[u] = dis;
    }
    
    
    rep(v, n){
        //隣接行列に辺がない
        if(M[u][v] == 0)    continue;
        //初探索の状態
        if(color[v] == WHITE){
            dfs_visit(v, flg);
            dis--;
        }
    }
    color[u] = BLACK;
}

void dfs(){
    int u;
    //初期化
    rep(u, n)   color[u] = WHITE;
    /*
    rep(u, n){
        //未訪問のuを始点として深さ優先探索
        if(color[u] == WHITE)   dfs_visit(u);
    }*/
    dfs_visit(0, true);
    dis = -1;
    rep(u, n)   color[u] = WHITE;
    dfs_visit(n - 1, false);
    
    //出力(略)
}

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int a, b;
    cin >> n;
    memset(M, 0, n * n);
    rep(i, n - 1){
        cin >> a >> b;
        M[a - 1][b - 1] = M[b - 1][a - 1] = 1;
    }
    //cout << "dfs start" << endl;
    dfs();
    //printArray(dis_F, n);
    //printArray(dis_S, n);
    int black = 0, white = 0;
    rep(i, n){
        if(dis_F[i] <= dis_S[i]){
            black++;
        }else{
            white++;
        }
    }
    if(black > white){
        cout << "Fennec" << endl;
    }else{
        cout << "Snuke" << endl;
    }
}

//配列の表示
void printArray(int array[], int n){
    rep(i, n){
        if(i)   cout << " ";
        cout << array[i];
    }
    cout << endl;
}

//二次元配列の表示
void printDimention(DVector &dv){
    rep(i, (int)dv.size()){
        rep(j, (int)dv[i].size()){
            if(j)   cout << " ";
            cout << dv[i][j];
        }
        cout << endl;
    }
}

Compiler output:
/tmp/cc1JGL9w.o: in function `dfs_visit(int, bool)':
a.cc:(.text+0x2f): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc1JGL9w.o
a.cc:(.text+0x57): relocation truncated to fit: R_X86_64_PC32 against symbol `dis_F' defined in .bss section in /tmp/cc1JGL9w.o
a.cc:(.text+0x77): relocation truncated to fit: R_X86_64_PC32 against symbol `dis_S' defined in .bss section in /tmp/cc1JGL9w.o
a.cc:(.text+0xc2): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc1JGL9w.o
a.cc:(.text+0xf6): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc1JGL9w.o
a.cc:(.text+0x10f): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc1JGL9w.o
/tmp/cc1JGL9w.o: in function `dfs()':
a.cc:(.text+0x13e): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc1JGL9w.o
a.cc:(.text+0x14f): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc1JGL9w.o
a.cc:(.text+0x18a): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc1JGL9w.o
a.cc:(.text+0x19b): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/cc1JGL9w.o
a.cc:(.text+0x1a6): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status