stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <string>

#include <cstdio>

#include <vector>

#include <queue>

#include <list>

#include <cstdlib>

#include <algorithm>

#include <set>

#include <map>

#include <deque>

#include <cstring>

#include <cmath>

//#include<bits/stdc++.h>

using namespace std;



const int INF=0x3f3f3f3f;

const int SIZE=100005;



vector<int> mp[SIZE];

int color[SIZE],dist[SIZE],dist2[SIZE];

bool vis[SIZE];



void bfs(int s,int dist[]){

	queue<int> que;

	que.push(s);

	while(!que.empty()){

		int u=que.front();

		que.pop();

		for(int i=0;i<mp[u].size();i++){

			int t=mp[u][i];

			if(dist[t] || t==s) continue;

			dist[t]=dist[u]+1;

			que.push(t);

		}

	}

}



void go(int p,int left,int col,int dist[]){

	if(color[p]) return;

	if(!left) return;

	color[p]=col;

	for(int i=0;i<mp[p].size();i++){

		int u=mp[p][i];

		if(dist[u]>dist[p]) continue;

		go(u,left-1,col,dist);

	}

}



void go2(int p){

	if(color[p]==2) return;

	if(vis[p]) return;

	vis[p]=true;

	color[p]=1;

	for(int i=0;i<mp[p].size();i++){

		int u=mp[p][i];

		go2(u);

	}

}



int main(){

	int n;

	cin>>n;

	for(int i=0,a,b;i<n-1;i++){

		cin>>a>>b;

		a--;

		b--;

		mp[a].push_back(b);

		mp[b].push_back(a);

	}

	bfs(n-1,dist);

	bfs(0,dist2);

//	for(int i=0;i<n;i++){

//		cout<<dist[i]<<' ';

//	}

//	cout<<endl;

//	for(int i=0;i<n;i++){

//		cout<<dist2[i]<<' ';

//	}

//	cout<<endl;

	int s=(dist[0]+1)/2;

	int f=(dist[0]+1)-s;

//	cout<<f<<' '<<s<<endl;

	go(0,f,1,dist);

	go(n-1,s,2,dist2);

//	int ttt=0;

//	for(int i=0;i<n;i++) if(color[i]==2) ttt++;

//	cout<<ttt<<endl;

	go2(0);

	f=0;

	for(int i=0;i<n;i++) if(color[i]==1) f++;

	s=n-f;

//	cout<<f<<' '<<s<<endl;

	if(s>=f){

		cout<<"Snuke\n";

	}

	else{

		cout<<"Fennec\n";

	}

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 2.5507560996592478x):
#include <bits/stdc++.h>

using namespace std;



int dis0[100005], dis1[100005];



struct edge {

    int to, next;

} eg[200010];

int head[100005], tot = 0;



void init() {

    memset(head, 0xff, sizeof(head));

    tot = 0;

}



void addedge(int from, int to) {

    eg[tot] = {to, head[from]};

    head[from] = tot++;

}



void dfs(int u, int pa, int* d) {

    if(pa != -1) d[u] = d[pa] + 1;

    else d[u] = 0;

    for(int i = head[u]; i != -1; i = eg[i].next) {

        int to = eg[i].to;

        if(to != pa) {

            dfs(to, u, d);

        }

    }

}



int main() {

    int n;

    scanf("%d", &n);

    init();

    for(int i = 0; i < n - 1; ++i) {

        int u, v;

        scanf("%d %d", &u, &v);

        addedge(u, v);

        addedge(v, u);

    }

    dfs(1, -1, dis0);

    dfs(n, -1, dis1);

    int lcnt = 0, rcnt = 0;

//    for(int i = 1; i <= n; ++i) {

//        printf("%d %d\n", dis0[i], dis1[i]);

//    }

    for(int i = 1; i <= n; ++i) {

        if(dis0[i] <= dis1[i]) ++lcnt;

        else ++rcnt;

    }

//    printf("%d %d\n", lcnt, rcnt);

    if(lcnt > rcnt) {

        puts("Fennec");

    } else {

        puts("Snuke");

    }

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int n,a,b;vector<int> g[100005];int d1[100005],d2[100005];void dfs(int r,int f,int d,int dist[]){dist[r]=d;for(int x=0;x<g[r].size();x++)if(g[r][x]!=f)dfs(g[r][x],r,d+1,dist);}int main(){cin>>n;for(int i=0;i<n-1;i++){cin>>a>>b;a--,b--;g[a].push_back(b);g[b].push_back(a);}dfs(0,-1,0,d1);dfs(n-1,-1,0,d2);int ans=0;for(int i=0;i<n;i++)if(d1[i]<=d2[i])ans++;else ans--;if(ans>0)cout <<"Fennec"<< endl;else cout<<"Snuke"<<endl;}

// Faster C++ solution for the same problem (measured speedup: 2.5519026850971898x):
#include <bits/stdc++.h>

using namespace std;



int dis0[100005], dis1[100005];



struct edge {

    int to, next;

} eg[200010];

int head[100005], tot = 0;



void init() {

    memset(head, 0xff, sizeof(head));

    tot = 0;

}



void addedge(int from, int to) {

    eg[tot] = {to, head[from]};

    head[from] = tot++;

}



void dfs(int u, int pa, int* d) {

    if(pa != -1) d[u] = d[pa] + 1;

    else d[u] = 0;

    for(int i = head[u]; i != -1; i = eg[i].next) {

        int to = eg[i].to;

        if(to != pa) {

            dfs(to, u, d);

        }

    }

}



int main() {

    int n;

    scanf("%d", &n);

    init();

    for(int i = 0; i < n - 1; ++i) {

        int u, v;

        scanf("%d %d", &u, &v);

        addedge(u, v);

        addedge(v, u);

    }

    dfs(1, -1, dis0);

    dfs(n, -1, dis1);

    int lcnt = 0, rcnt = 0;

//    for(int i = 1; i <= n; ++i) {

//        printf("%d %d\n", dis0[i], dis1[i]);

//    }

    for(int i = 1; i <= n; ++i) {

        if(dis0[i] <= dis1[i]) ++lcnt;

        else ++rcnt;

    }

//    printf("%d %d\n", lcnt, rcnt);

    if(lcnt > rcnt) {

        puts("Fennec");

    } else {

        puts("Snuke");

    }

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int maxn=1e5+10;



vector<int> g[maxn];

int dis1[maxn],dis2[maxn];



void init() {

    memset(dis1,0,sizeof(dis1));

    memset(dis2,0,sizeof(dis2));

    for(int i=0;i<maxn;i++)g[i].clear();

}



void dfs(int x,int f,int dis[],int dep){

    dis[x]=dep;

    for(int i=0;i<g[x].size();i++){

        if(g[x][i]!=f)dfs(g[x][i],x,dis,dep+1);

    }

}



int main() {

    int n,x,y;

    while(scanf("%d",&n)!=EOF) {

        init();

        for(int i=1; i<n; i++) {

            scanf("%d%d",&x,&y);

            g[x].push_back(y);

            g[y].push_back(x);

        }

        dfs(1,-1,dis1,0);

        dfs(n,-1,dis2,0);

        int cnt=0;

        for(int i=1; i<=n; i++) {

            if(dis1[i]<=dis2[i])cnt++;

            else cnt--;

        }

        if(cnt>0){

            puts("Fennec");

        }else{

            puts("Snuke");

        }

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 3.377060594955145x):
#include <bits/stdc++.h>

using namespace std;



int dis0[100005], dis1[100005];



struct edge {

    int to, next;

} eg[200010];

int head[100005], tot = 0;



void init() {

    memset(head, 0xff, sizeof(head));

    tot = 0;

}



void addedge(int from, int to) {

    eg[tot] = {to, head[from]};

    head[from] = tot++;

}



void dfs(int u, int pa, int* d) {

    if(pa != -1) d[u] = d[pa] + 1;

    else d[u] = 0;

    for(int i = head[u]; i != -1; i = eg[i].next) {

        int to = eg[i].to;

        if(to != pa) {

            dfs(to, u, d);

        }

    }

}



int main() {

    int n;

    scanf("%d", &n);

    init();

    for(int i = 0; i < n - 1; ++i) {

        int u, v;

        scanf("%d %d", &u, &v);

        addedge(u, v);

        addedge(v, u);

    }

    dfs(1, -1, dis0);

    dfs(n, -1, dis1);

    int lcnt = 0, rcnt = 0;

//    for(int i = 1; i <= n; ++i) {

//        printf("%d %d\n", dis0[i], dis1[i]);

//    }

    for(int i = 1; i <= n; ++i) {

        if(dis0[i] <= dis1[i]) ++lcnt;

        else ++rcnt;

    }

//    printf("%d %d\n", lcnt, rcnt);

    if(lcnt > rcnt) {

        puts("Fennec");

    } else {

        puts("Snuke");

    }

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int a,b,n;

vector<int> g[100005];

int distance_Fennec[100005]; //ふぇねえええええええええええええええええええええええええええええっく

int distance_Sunuke[100005];



void calc_distance(int r, int f, int d, int dist[]) {

	dist[r] = d;

	for(int x = 0; x < g[r].size(); x++)

		if (g[r][x] != f) calc_distance(g[r][x], r, d + 1, dist);

			

}

int main()

{

	cin>>n;

	for(int i = 0; i < n - 1; i++) {

		cin>>a>>b;

		a--,b--;

		g[a].push_back(b);

		g[b].push_back(a);

	}

	calc_distance(0  ,-1,0,distance_Fennec);

	calc_distance(n-1,-1,0,distance_Sunuke);

	int ans = 0;

	for(int i = 0;i < n; i++){

		if(distance_Fennec[i] <= distance_Sunuke[i]) ans++;

		else ans--;

	}

	printf("%s\n",(ans > 0) ? "Fennec" : "Snuke");

}

// Faster C++ solution for the same problem (measured speedup: 3.500232425052957x):
#include <bits/stdc++.h>

using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

vector<bool> seen;

void dfs(const Graph &G,int v,int before,int step,vector<int> &Array) {

		Array[v]=step;

    for(int i=0;i<G[v].size();i++)

			if(G[v][i]!=before) dfs(G,G[v][i],v,step+1,Array);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	cin>>N;

	vector<int> Fennec(N+10);

	vector<int> Sunuke(N+10);

	Graph G(N+10);

	for(int i=0;i<N-1;i++){

		cin>>a>>b;

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(G,0,-1,0,Fennec);

	dfs(G,N-1,-1,0,Sunuke);



//	for(int i=0;i<N;i++) cout<<Fennec[i]<<" ";

//	cout<<endl;

//	for(int i=0;i<N;i++) cout<<Sunuke[i]<<" ";

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	printf("%s",(ans>0)?"Fennec":"Snuke");

}
// Slower C++ solution:
/*  include  */

#include <bits/stdc++.h>



/*  using namespace  */

using namespace std;



/*  local var  */

int a,b,n;		//input

int ans = 0;		//output

vector<int> g[100005];  //graph

int distance_Fennec[100005]; //Distance from ふぇねええええええええええええええええええええええええっく

int distance_Sunuke[100005]; //Distance from Snuke



/*  define  */

#define loop(i,j) for(int i = 0; i < j; i++)



/*  typedef  */

//None



/*  distance checker  */

void calc_distance(int r, int f, int d, int dist[]) {

	dist[r] = d;

	for(int x = 0; x < g[r].size(); x++)

		if (g[r][x] != f) calc_distance(g[r][x], r, d + 1, dist);

			

}



/*  main program  */

int main()

{

	cin>>n;



	for(int i = 0; i < n - 1; i++) {

		cin>>a>>b;

		a--,b--;

		g[a].push_back(b);

		g[b].push_back(a);

	}



	calc_distance(0  ,-1,0,distance_Fennec);

	calc_distance(n-1,-1,0,distance_Sunuke);



	for(int i = 0;i < n; i++){

		if(distance_Fennec[i] <= distance_Sunuke[i]) ans++;

		else ans--;

	}



	printf("%s\n",(ans > 0) ? "Fennec" : "Snuke");

}


// Faster C++ solution for the same problem (measured speedup: 3.5003437232915373x):
#include <bits/stdc++.h>

using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

vector<bool> seen;

void dfs(const Graph &G,int v,int before,int step,vector<int> &Array) {

		Array[v]=step;

    for(int i=0;i<G[v].size();i++)

			if(G[v][i]!=before) dfs(G,G[v][i],v,step+1,Array);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	cin>>N;

	vector<int> Fennec(N+10);

	vector<int> Sunuke(N+10);

	Graph G(N+10);

	for(int i=0;i<N-1;i++){

		cin>>a>>b;

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(G,0,-1,0,Fennec);

	dfs(G,N-1,-1,0,Sunuke);



//	for(int i=0;i<N;i++) cout<<Fennec[i]<<" ";

//	cout<<endl;

//	for(int i=0;i<N;i++) cout<<Sunuke[i]<<" ";

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	printf("%s",(ans>0)?"Fennec":"Snuke");

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

int a,b,n;

vector<int> g[100005];

int distance_Fennec[100005]; //ふぇねえええええええええええええええええええええええええええええっく

int distance_Sunuke[100005];



void calc_distance(int r, int f, int d, int dist[]) {

	dist[r] = d;

	for(int x = 0; x < g[r].size(); x++)

		if (g[r][x] != f) calc_distance(g[r][x], r, d + 1, dist);

			

}

int main()

{

	cin>>n;

	for(int i = 0; i < n - 1; i++) {

		cin>>a>>b;

		a--,b--;

		g[a].push_back(b);

		g[b].push_back(a);

	}

	calc_distance(0  ,-1,0,distance_Fennec);

	calc_distance(n-1,-1,0,distance_Sunuke);

	int ans = 0;

	for(int i = 0;i < n; i++){

		if(distance_Fennec[i] <= distance_Sunuke[i]) ans++;

		else ans--;

	}

	printf("%s\n",(ans > 0) ? "Fennec" : "Snuke");

}

// Faster C++ solution for the same problem (measured speedup: 3.5320470036316314x):
#include <bits/stdc++.h>



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

vector<bool> seen;

void dfs(const Graph &G,int v,int before,int step,vector<int> &Array) {

		Array[v]=step;

    for(int i=0;i<G[v].size();i++)

			if(G[v][i]!=before) dfs(G,G[v][i],v,step+1,Array);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

	vector<int> Fennec(N+10);

	vector<int> Sunuke(N+10);

	Graph G(N+10);

	for(int i=0;i<N-1;i++){

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(G,0,-1,0,Fennec);

	dfs(G,N-1,-1,0,Sunuke);



//	for(int i=0;i<N;i++) cout<<Fennec[i]<<" ";

//	cout<<endl;

//	for(int i=0;i<N;i++) cout<<Sunuke[i]<<" ";

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	printf("%s",(ans>0)?"Fennec":"Snuke");

}
// Slower C++ solution:
/*  include  */

#include <bits/stdc++.h>



/*  using namespace  */

using namespace std;



/*  local var  */

int a,b,n;		//input

int ans = 0;		//output

vector<int> g[100005];  //graph

int distance_Fennec[100005]; //Distance from ふぇねええええええええええええええええええええええええっく

int distance_Sunuke[100005]; //Distance from Snuke



/*  define  */

#define loop(i,j) for(int i = 0; i < j; i++)



/*  typedef  */

//None



/*  distance checker  */

void calc_distance(int r, int f, int d, int dist[]) {

	dist[r] = d;

	for(int x = 0; x < g[r].size(); x++)

		if (g[r][x] != f) calc_distance(g[r][x], r, d + 1, dist);

			

}



/*  main program  */

int main()

{

	cin>>n;



	for(int i = 0; i < n - 1; i++) {

		cin>>a>>b;

		a--,b--;

		g[a].push_back(b);

		g[b].push_back(a);

	}



	calc_distance(0  ,-1,0,distance_Fennec);

	calc_distance(n-1,-1,0,distance_Sunuke);



	for(int i = 0;i < n; i++){

		if(distance_Fennec[i] <= distance_Sunuke[i]) ans++;

		else ans--;

	}



	printf("%s\n",(ans > 0) ? "Fennec" : "Snuke");

}


// Faster C++ solution for the same problem (measured speedup: 3.532159313490621x):
#include <bits/stdc++.h>



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

vector<bool> seen;

void dfs(const Graph &G,int v,int before,int step,vector<int> &Array) {

		Array[v]=step;

    for(int i=0;i<G[v].size();i++)

			if(G[v][i]!=before) dfs(G,G[v][i],v,step+1,Array);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

	vector<int> Fennec(N+10);

	vector<int> Sunuke(N+10);

	Graph G(N+10);

	for(int i=0;i<N-1;i++){

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(G,0,-1,0,Fennec);

	dfs(G,N-1,-1,0,Sunuke);



//	for(int i=0;i<N;i++) cout<<Fennec[i]<<" ";

//	cout<<endl;

//	for(int i=0;i<N;i++) cout<<Sunuke[i]<<" ";

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	printf("%s",(ans>0)?"Fennec":"Snuke");

}
// Slower C++ solution:
#include <bits/stdc++.h>



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

Graph G(200005);

vector<int> Fennec(200005);

vector<int> Sunuke(200005);

void dfs(int v,int before,int step,bool f) {

		if(f) Fennec[v]=step;

		else Sunuke[v]=step;

    for(int i=0;i<G[v].size();i++)

			if(G[v][i]!=before) dfs(G[v][i],v,step+1,f);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

	for(int i=0;i<N-1;i++){

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(0,-1,0,true);

	dfs(N-1,-1,0,false);



//	for(int i=0;i<N;i++) cout<<Fennec[i]<<" ";

//	cout<<endl;

//	for(int i=0;i<N;i++) cout<<Sunuke[i]<<" ";

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	printf("%s",(ans>0)?"Fennec":"Snuke");

}


// Faster C++ solution for the same problem (measured speedup: 1.8625505109686034x):
#include <bits/stdc++.h>



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

Graph G(100005);

vector<int> Fennec(100005);

vector<int> Sunuke(100005);

void dfs(int v,int before,int step,bool f) {

		if(f) Fennec[v]=step;

		else Sunuke[v]=step;

    for(int i=0;i<G[v].size();i++)

			if(G[v][i]!=before) dfs(G[v][i],v,step+1,f);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

	for(int i=0;i<N-1;i++){

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(0,-1,0,true);

	dfs(N-1,-1,0,false);



//	for(int i=0;i<N;i++) cout<<Fennec[i]<<" ";

//	cout<<endl;

//	for(int i=0;i<N;i++) cout<<Sunuke[i]<<" ";

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	printf("%s",(ans>0)?"Fennec":"Snuke");

}
// Slower C++ solution:
#include <bits/stdc++.h>



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

Graph G(200005);

vector<int> Fennec(200005);

vector<int> Sunuke(200005);

void dfs(int v,int before,int step,bool f) {

		if(f) Fennec[v]=step;

		else Sunuke[v]=step;

    for(int i=0;i<G[v].size();i++)

			if(G[v][i]!=before) dfs(G[v][i],v,step+1,f);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

	for(int i=0;i<N-1;i++){

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(0,-1,0,true);

	dfs(N-1,-1,0,false);



//	for(int i=0;i<N;i++) cout<<Fennec[i]<<" ";

//	cout<<endl;

//	for(int i=0;i<N;i++) cout<<Sunuke[i]<<" ";

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	printf("%s",(ans>0)?"Fennec":"Snuke");

}


// Faster C++ solution for the same problem (measured speedup: 2.3768040906459555x):
#include <bits/stdc++.h>



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

Graph G(100005);

int Fennec[100005];

int Sunuke[100005];



void dfs(int v,int before,int step,bool f) {

		if(f) Fennec[v]=step;

		else Sunuke[v]=step;

    for(int i=0;i<G[v].size();i++)

			if(G[v][i]!=before) dfs(G[v][i],v,step+1,f);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

	for(int i=0;i<N-1;i++){

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(0,-1,0,true);

	dfs(N-1,-1,0,false);

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	puts((ans>0)?"Fennec":"Snuke");

}
// Slower C++ solution:
#include <bits/stdc++.h>



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

Graph G(100005);

vector<int> Fennec(100005);

vector<int> Sunuke(100005);

void dfs(int v,int before,int step,bool f) {

		if(f) Fennec[v]=step;

		else Sunuke[v]=step;

    for(int i=0;i<G[v].size();i++)

			if(G[v][i]!=before) dfs(G[v][i],v,step+1,f);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

	for(int i=0;i<N-1;i++){

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(0,-1,0,true);

	dfs(N-1,-1,0,false);



//	for(int i=0;i<N;i++) cout<<Fennec[i]<<" ";

//	cout<<endl;

//	for(int i=0;i<N;i++) cout<<Sunuke[i]<<" ";

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	printf("%s",(ans>0)?"Fennec":"Snuke");

}


// Faster C++ solution for the same problem (measured speedup: 1.2761018166481397x):
#include <bits/stdc++.h>



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

Graph G(100005);

int Fennec[100005];

int Sunuke[100005];



void dfs(int v,int before,int step,bool f) {

		if(f) Fennec[v]=step;

		else Sunuke[v]=step;

    for(int i=0;i<G[v].size();i++)

			if(G[v][i]!=before) dfs(G[v][i],v,step+1,f);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

	for(int i=0;i<N-1;i++){

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(0,-1,0,true);

	dfs(N-1,-1,0,false);

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	puts((ans>0)?"Fennec":"Snuke");

}
// Slower C++ solution:
#include <iostream>

#include <vector>

using namespace std;

#define ll long long 

int n;

vector<int> g[200005];

int d1[100005],d2[100005];

inline void dfs(int r,int f,int d,int dist[])

{

    dist[r]=d;

    for(int x=0;x<g[r].size();x++){

        if(g[r][x]!=f){

        	dfs(g[r][x],r,d+1,dist);

		}

    }

}

int main()

{

    cin>>n;

    for(int i=0;i<n-1;i++)

    {

    	int a,b;

        cin>>a>>b;

        a--,b--;

        g[a].push_back(b);

        g[b].push_back(a);

    }

    dfs(0,-1,0,d1);

    dfs(n-1,-1,0,d2);

    int ans=0;

    for(int i=0;i<n;i++){

        if(d1[i]<=d2[i]){

            ans++;

		}

        else{

        	ans--;

        }

    }

    if(ans>0){

    	cout <<"Fennec"<< endl;

	}

    else{

    	cout<<"Snuke"<<endl;

	}

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 6.417064887595985x):
#include<iostream>

#include<string>

#include<stdlib.h> 

#include<cstring>

#include<map>

#include<list>

#include<stdio.h>

#include<cmath>

#include<iomanip>

#include<bitset>

#include<vector>

#include<time.h>

#include<algorithm> 

#include<queue>

#include<set>

#include<deque>

#define mod 1e9+7

#define inf 1e18 

typedef long long ll;

typedef long double ld;

using namespace std;

typedef list<ll> li;

typedef list<ll>::iterator lt;

li sh_r;

ll N,s;

vector<li>a;

bool dfs(ll step,ll x,ll f){

	if(x>N)cout<<f<<" "<<x<<endl;

	if(x==N){

	  s=step;

	  return true;

    }

	for(lt it=a[x].begin();it!=a[x].end();it++){

		if(*it==f)continue;

		if(dfs(step+1,*it,x)){

			sh_r.push_back(x);

			return true;

		}

	}

	return false;

}

ll num(ll x,ll f){

	ll n=1;

	for(lt it=a[x].begin();it!=a[x].end();it++){

		if(*it==f)continue;

		n+=num(*it,x);

	}

	return n;

}

int main(){	

    cin>>N;

    a.resize(N+10);

    for(ll K=1;K<N;K++){

    	ll x,y;

    	scanf("%lld%lld",&x,&y);

    	a[x].push_back(y);

    	a[y].push_back(x);

	}

	dfs(0,1,-1);

	s--;

	ll F=1,S=N;

	if(N!=2){

		ll j=s/2;

		for(lt it=sh_r.begin();it!=sh_r.end();it++){

			j--;

			if(j==0)S=*it;

			if(j==-1){

				F=*it;

				break;

			}

		}

	}

	ll Fen=num(F,S);

	ll Snu=num(S,F);

	if(Fen>Snu)printf("Fennec");

	else printf("Snuke");

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

using namespace std;

#define ll long long 

int n;

vector<int> g[200005];

int d1[100005],d2[100005];

inline void dfs(int r,int f,int d,int dist[])

{

    dist[r]=d;

    for(int x=0;x<g[r].size();x++){

        if(g[r][x]!=f){

        	dfs(g[r][x],r,d+1,dist);

		}

    }

}

int main()

{

    cin>>n;

    for(int i=0;i<n-1;i++)

    {

    	int a,b;

        cin>>a>>b;

        a--,b--;

        g[a].push_back(b);

        g[b].push_back(a);

    }

    dfs(0,-1,0,d1);

    dfs(n-1,-1,0,d2);

    int ans=0;

    for(int i=0;i<n;i++){

        if(d1[i]<=d2[i]){

            ans++;

		}

        else{

        	ans--;

        }

    }

    if(ans>0){

    	cout <<"Fennec"<< endl;

	}

    else{

    	cout<<"Snuke"<<endl;

	}

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 4.543302640416372x):
#include <bits/stdc++.h>

using namespace std;



const int N=110000;

struct Edge {

    int go,next;

} eg[N<<1];

int last[N],tot;

int fa[N],dis[N],sz[N];



void addedge(int x,int y)

{

    eg[tot]={y,last[x]};

    last[x]=tot++;

}



void dfs(int u,int f,int d)

{

    fa[u]=f;dis[u]=d;sz[u]=1;

    for (int i=last[u];i!=-1;i=eg[i].next) {

        int v=eg[i].go;

        if (v==f) continue;

        dfs(v,u,d+1);

        sz[u]+=sz[v];

    }

}



int main()

{

    int n;

    scanf("%d",&n);

    tot=0;

    memset(last,-1,sizeof(last));

    for (int i=1;i<n;i++) {

        int x,y;

        scanf("%d%d",&x,&y);

        addedge(x,y);

        addedge(y,x);

    }

    dfs(1,0,0);

//    for (int i=1;i<=n;i++) {

//        printf("%d ",dis[i]);

//    }

//    puts("");

//    for (int i=1;i<=n;i++) {

//        printf("%d ",fa[i]);

//    }

//    puts("");

//    for (int i=1;i<=n;i++) {

//        printf("%d ",sz[i]);

//    }

//    puts("");

    int d=dis[n]-1;

    int h=0,x=n;

    while ((h+1+h+1)<=d) {

        x=fa[x];++h;

    }

    puts(n-sz[x]>sz[x]?"Fennec":"Snuke");

    return 0;

}