stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;





int us[200005],n,m=0,c[200005],a1=0,a2=0;

vector<int>e[100005];

void dfs(int v,int l)

{

    int i;

    if(v==n)

    {

        m=l;

        return ;

    }

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

    {

        if(us[e[v][i]]==0)

        {

            us[e[v][i]]=1;

            dfs(e[v][i],l+1);

        }

        if(m>0)

        {

            if(l<=m/2)

            {

                c[v]=1;

            }

            else

            {

                c[v]=-1;

            }

            return ;

        }

    }

}

void dfs1(int v)

{

    if(c[v]==-1)

    {

        return ;

    }

    a1++;

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

    {

        if(us[e[v][i]]==0)

        {

            us[e[v][i]]=1;

            dfs1(e[v][i]);

        }

    }

}

void dfs2(int v)

{

    if(c[v]==1)

    {

        return ;

    }

    a2++;

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

    {

        if(us[e[v][i]]==0)

        {

            us[e[v][i]]=1;

            dfs2(e[v][i]);

        }

    }

}

int main()

{

    int i,a,b;

    scanf("%d",&n);

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

    {

        scanf("%d %d",&a,&b);

        e[a].push_back(b);

        e[b].push_back(a);

    }

    c[1]=1;

    c[n]=-1;

    dfs(1,0);

    us[1]=1;

    memset(us,0,sizeof(us));

    dfs1(1);

    us[1]=1;

    memset(us,0,sizeof(us));

    dfs2(n);

    us[1]=1;

    if(a1>a2)

    {

        printf("Fennec\n");

    }

    else

    {

        printf("Snuke\n");

    }

    return 0;

}


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

#include<vector>

#include<queue>

using namespace std;

vector<int> G[100001];

int dis[2][100001];

void bfs(int j,int start)

{

	dis[j][start]=1;

	int now,i;

	queue<int> q;

	q.push(start);

	while(!q.empty())

	{

		now=q.front();

		q.pop();

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

		{

			if(dis[j][G[now][i]]==0)

			{

				dis[j][G[now][i]]=dis[j][now]+1;

				q.push(G[now][i]);

			}

		}

	}

}

int main()

{

	int n,i,j,s,e;

	scanf("%d",&n);

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

	{

		scanf("%d%d",&s,&e);

		G[s].push_back(e);

		G[e].push_back(s);

	}

	bfs(0,1);

	bfs(1,n);

	s=0,e=0;

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

	{

		if(dis[0][i]<=dis[1][i])

			s++;

		else

			e++;

	}

	if(s>e)

		printf("Fennec");

	else

		printf("Snuke");

	return 0;

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



using namespace std;





int us[200005],n,m=0,c[200005],a1=0,a2=0;

vector<int>e[100005];

void dfs(int v,int l)

{

    int i;

    if(v==n)

    {

        m=l;

        return ;

    }

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

    {

        if(us[e[v][i]]==0)

        {

            us[e[v][i]]=1;

            dfs(e[v][i],l+1);

        }

        if(m>0)

        {

            if(l<=m/2)

            {

                c[v]=1;

            }

            else

            {

                c[v]=-1;

            }

            return ;

        }

    }

}

void dfs1(int v)

{

    if(c[v]==-1)

    {

        return ;

    }

    a1++;

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

    {

        if(us[e[v][i]]==0)

        {

            us[e[v][i]]=1;

            dfs1(e[v][i]);

        }

    }

}

void dfs2(int v)

{

    if(c[v]==1)

    {

        return ;

    }

    a2++;

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

    {

        if(us[e[v][i]]==0)

        {

            us[e[v][i]]=1;

            dfs2(e[v][i]);

        }

    }

}

int main()

{

    int i,a,b;

    scanf("%d",&n);

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

    {

        scanf("%d %d",&a,&b);

        e[a].push_back(b);

        e[b].push_back(a);

    }

    c[1]=1;

    c[n]=-1;

    dfs(1,0);

    us[1]=1;

    memset(us,0,sizeof(us));

    dfs1(1);

    us[1]=1;

    memset(us,0,sizeof(us));

    dfs2(n);

    us[1]=1;

    if(a1>a2)

    {

        printf("Fennec\n");

    }

    else

    {

        printf("Snuke\n");

    }

    return 0;

}


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

#include<queue>

#include<vector>

#include<bits/stdc++.h>

using namespace std;

const int MAXN=100000+10;

vector<int> edge[MAXN];

int n,cnt[3];

int tree[MAXN];

void bfs()

{

    queue<int> q;

    q.push(1),q.push(n);

    while(!q.empty())

    {

        int temp=q.front();

        q.pop();

        cnt[tree[temp]]++;

        for(int i=0;i<edge[temp].size();++i)

        {

            int v=edge[temp][i];

            if(tree[v])continue;

            else tree[v]=tree[temp];

            q.push(v);

        }

    }

}



int main()

{

    memset(tree,0,sizeof(tree));

    cin>>n;

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

    {

        int x,y;

        cin>>x>>y;

        edge[x].push_back(y);

        edge[y].push_back(x);

    }

    tree[1]=1,tree[n]=2;

    bfs();

    if(cnt[2]>=cnt[1])

        cout<<"Snuke"<<endl;

    else

        cout<<"Fennec"<<endl;

    return 0;

}
// Slower C++ solution:
//by spj

#include <bits/stdc++.h>

using namespace std;

vector < int > g[200005];

int n,dist1[200005],dist2[200005];

void dfs1(int pos,int depth)

{

	if(dist1[pos] != -1)

		return;

	dist1[pos] = depth;

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

		dfs1(g[pos][i],depth + 1);

}

void dfs2(int pos,int depth)

{

	if(dist2[pos] != -1)

		return;

	dist2[pos] = depth;

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

		dfs2(g[pos][i],depth + 1);

}

int main()

{

	cin >> n;

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

	{

		int x,y;

		cin >> x >> y;

		g[x].push_back(y);

		g[y].push_back(x);

	}

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

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

	dfs1(1,0);

	dfs2(n,0);

	int cnt1 = 0,cnt2 = 0;

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

		if(dist1[i] <= dist2[i])

			cnt1++;

		else

			cnt2++;

	if(cnt1 > cnt2)

		puts("Fennec");

	else

		puts("Snuke");

	return 0;

}

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

#include<queue>

#include<vector>

#include<bits/stdc++.h>

using namespace std;

const int MAXN=100000+10;

vector<int> edge[MAXN];

int n,cnt[3];

int tree[MAXN];

void bfs()

{

    queue<int> q;

    q.push(1),q.push(n);

    while(!q.empty())

    {

        int temp=q.front();

        q.pop();

        cnt[tree[temp]]++;

        for(int i=0;i<edge[temp].size();++i)

        {

            int v=edge[temp][i];

            if(tree[v])continue;

            else tree[v]=tree[temp];

            q.push(v);

        }

    }

}



int main()

{

    memset(tree,0,sizeof(tree));

    cin>>n;

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

    {

        int x,y;

        cin>>x>>y;

        edge[x].push_back(y);

        edge[y].push_back(x);

    }

    tree[1]=1,tree[n]=2;

    bfs();

    if(cnt[2]>=cnt[1])

        cout<<"Snuke"<<endl;

    else

        cout<<"Fennec"<<endl;

    return 0;

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

#include<vector>

#include<algorithm>

#include<list>

#include<set>

using namespace std;



int n;



vector<int> fenech(1000001);

vector<int> sunuke(1000001);

set<int> se;



void dfs(int c,int depth,vector<vector<int> >& tree,bool f){



	if(f){

		fenech[c] = depth;

	}else{

		sunuke[c] = depth;

	}



	for(int i=0;i<tree[c].size();++i){

		int next = tree[c][i];

		if(se.find(next) != se.end()) continue;

		se.insert(next);

		dfs(next,depth+1,tree,f);

	}

}





int main(){

	cin >> n;

	vector<vector<int> > tree(n+1);



	int a,b;

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

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}



	se.insert(1);

	dfs(1,0,tree,true);

	se.clear();

	se.insert(n);

	dfs(n,0,tree,false);



	int nfenech = 0;

	int nsunuke = 0;



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

		if(fenech[i] <= sunuke[i]){

			nfenech++;

		}else{

			nsunuke++;

		}

	}



	if(nfenech > nsunuke) cout << "Fennec" <<endl;

	else cout << "Snuke" <<endl;

	

	return 0;

}






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

#include<vector>

#include<algorithm>

#include<list>

#include<set>

using namespace std;







void dfs(int c,int depth,vector<vector<int> >& tree, vector<int>& memo){

	if(memo[c] != -1) return;

	memo[c] = depth;



	for(int i=0;i<tree[c].size();++i){

		int next = tree[c][i];

		dfs(next,depth+1,tree,memo);

	}

}





int main(){

	int n;

	cin >> n;

	vector<vector<int> > tree(n+1);

	vector<int> fenech(n+1,-1);

	vector<int> sunuke(n+1,-1);



	int a,b;

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

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}



	dfs(1,0,tree,fenech);

	dfs(n,0,tree,sunuke);



	int nfenech = 0;

	int nsunuke = 0;



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

		if(fenech[i] <= sunuke[i]){

			nfenech++;

		}else{

			nsunuke++;

		}

	}



	if(nfenech > nsunuke) cout << "Fennec" <<endl;

	else cout << "Snuke" <<endl;

	

	return 0;

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

#include<vector>

#include<algorithm>

#include<list>

#include<set>

using namespace std;



int n;



vector<int> fenech(1000001,-1);

vector<int> sunuke(1000001,-1);

set<int> se;



void dfs(int c,int depth,vector<vector<int> >& tree, vector<int>& memo){

	if(memo[c] != -1) return;

	memo[c] = depth;



	for(int i=0;i<tree[c].size();++i){

		int next = tree[c][i];

		dfs(next,depth+1,tree,memo);

	}

}





int main(){

	cin >> n;

	vector<vector<int> > tree(n+1);



	int a,b;

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

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}



	se.insert(1);

	dfs(1,0,tree,fenech);

	se.clear();

	se.insert(n);

	dfs(n,0,tree,sunuke);



	int nfenech = 0;

	int nsunuke = 0;



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

		if(fenech[i] <= sunuke[i]){

			nfenech++;

		}else{

			nsunuke++;

		}

	}



	if(nfenech > nsunuke) cout << "Fennec" <<endl;

	else cout << "Snuke" <<endl;

	

	return 0;

}






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

#include<vector>

#include<algorithm>

#include<list>

#include<set>

using namespace std;







void dfs(int c,int depth,vector<vector<int> >& tree, vector<int>& memo){

	if(memo[c] != -1) return;

	memo[c] = depth;



	for(int i=0;i<tree[c].size();++i){

		int next = tree[c][i];

		dfs(next,depth+1,tree,memo);

	}

}





int main(){

	int n;

	cin >> n;

	vector<vector<int> > tree(n+1);

	vector<int> fenech(n+1,-1);

	vector<int> sunuke(n+1,-1);



	int a,b;

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

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}



	dfs(1,0,tree,fenech);

	dfs(n,0,tree,sunuke);



	int nfenech = 0;

	int nsunuke = 0;



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

		if(fenech[i] <= sunuke[i]){

			nfenech++;

		}else{

			nsunuke++;

		}

	}



	if(nfenech > nsunuke) cout << "Fennec" <<endl;

	else cout << "Snuke" <<endl;

	

	return 0;

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

#include<vector>

#include<algorithm>

#include<list>

#include<set>

using namespace std;



int n;



vector<int> fenech(1000001,-1);

vector<int> sunuke(1000001,-1);



void dfs(int c,int depth,vector<vector<int> >& tree, vector<int>& memo){

	if(memo[c] != -1) return;

	memo[c] = depth;



	for(int i=0;i<tree[c].size();++i){

		int next = tree[c][i];

		dfs(next,depth+1,tree,memo);

	}

}





int main(){

	cin >> n;

	vector<vector<int> > tree(n+1);



	int a,b;

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

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}



	dfs(1,0,tree,fenech);

	dfs(n,0,tree,sunuke);



	int nfenech = 0;

	int nsunuke = 0;



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

		if(fenech[i] <= sunuke[i]){

			nfenech++;

		}else{

			nsunuke++;

		}

	}



	if(nfenech > nsunuke) cout << "Fennec" <<endl;

	else cout << "Snuke" <<endl;

	

	return 0;

}






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

#include<vector>

#include<algorithm>

#include<list>

#include<set>

using namespace std;







void dfs(int c,int depth,vector<vector<int> >& tree, vector<int>& memo){

	if(memo[c] != -1) return;

	memo[c] = depth;



	for(int i=0;i<tree[c].size();++i){

		int next = tree[c][i];

		dfs(next,depth+1,tree,memo);

	}

}





int main(){

	int n;

	cin >> n;

	vector<vector<int> > tree(n+1);

	vector<int> fenech(n+1,-1);

	vector<int> sunuke(n+1,-1);



	int a,b;

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

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}



	dfs(1,0,tree,fenech);

	dfs(n,0,tree,sunuke);



	int nfenech = 0;

	int nsunuke = 0;



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

		if(fenech[i] <= sunuke[i]){

			nfenech++;

		}else{

			nsunuke++;

		}

	}



	if(nfenech > nsunuke) cout << "Fennec" <<endl;

	else cout << "Snuke" <<endl;

	

	return 0;

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

using namespace std;

vector<int>v[200000];

int t[200000];

int main()

{

	int n;

	cin>>n;

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

	{

		int x,y;

		cin>>x>>y;

		v[x].push_back(y);

		v[y].push_back(x);

	}

	queue<int>q;

	q.push(1);

	q.push(n);

	t[1]=1;

	t[n]=2;

    int f=0,s=0;

	while(!q.empty())

	{

		int a=q.front();

		q.pop();

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

		{

			int b=v[a][i];

			if(t[b]==0)

			{

				q.push(b);

				t[b]=t[a];

				if(t[b]==1)

					f++;

				else

					s++;

			}

		}

	}

	if(f>s)

		cout<<"Fennec";

	else

		cout<<"Snuke";



	return 0;

}

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

using namespace std;

vector<int>v[100000];

int a[2][100000];

int t;

void dfs(int k1,int k2=-1)

{

	if(k2!=-1)

		a[t][k1]=a[t][k2]+1;

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

	{

		if(v[k1][i]!=k2)

			dfs(v[k1][i],k1);

	}

}

int main()

{

	int n;

	cin>>n;

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

	{

		int x,y;

		cin>>x>>y;

		x--;

		y--;

		v[x].push_back(y);

		v[y].push_back(x);

	}

	t=0;

	dfs(0);

	t=1;

	dfs(n-1);

	int sum=0;

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

	{

		if(a[0][i]<=a[1][i])

			sum++;

	}

	if(sum>=n/2+1)

		cout<<"Fennec";

	else

		cout<<"Snuke";



	return 0;

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

#include <map>

#include <set>

#include <deque>

#include <queue>

#include <stack>

#include <bitset>

#include <algorithm>

#include <functional>

#include <numeric>

#include <climits>

#include <utility>

#include <sstream>

#include <iostream>

#include <iomanip>

#include <cstdio>

#include <cmath>

#include <cstdlib>

#include <cctype>

#include <string>

#include <cstring>

#include <ctime>

#define NDEBUG

#include <assert.h>

using namespace std;

const int INF=INT_MAX/4;

/*

Status:Writing

Type:Problemset/HB

Problem ID:Atcoder ARC B

Author:XIZCM

*/

int n,a,b;

vector<int> nei[100005];

//int dis[100005],rdis[100005];

vector<int> bfs(int start){

	vector<int> d(n,INF);

	d[start]=0;

	queue<int> q;

	q.push(start);

	while(!q.empty()){

		int t=q.front();

		q.pop();

		for(int i=0;i<nei[t].size();i++){

			int u=nei[t][i];

			if(d[u]>d[t]+1){

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

				q.push(u);

			}

		}

	}

	return d;

}

int main(){

	scanf("%d",&n);

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

		scanf("%d%d",&a,&b);

		a--;

		b--;

		nei[a].push_back(b);

		nei[b].push_back(a);

	}

	vector<int> dis=bfs(0);

	vector<int> rdis=bfs(n-1);

	int s=0,f=0;

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

		if(dis[i]>rdis[i]){

			s++;

		}

		else{

			f++;

		}

	}

	puts(f>s?"Fennec":"Snuke");

	return 0;

}


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

#include <cstring>

#include <queue>

using namespace std;

const int maxn = 1e5 + 10;

const int maxm = 1e5 + 10;

struct edge{

	int to;

	int next;

}Edge[2 * maxm];

int head[maxn], pos, n, color[maxn];

void init(){

	for(int i = 0; i < maxn; i++) head[i] = -1;

	for(int i = 0; i < maxn; i++) color[i] = -1; // -1 is uncolored 1 is whrite, 0 is black

	pos = 0;

}

void addEdge(int u, int v){

	Edge[pos].to = v;

	Edge[pos].next = head[u];

	head[u] = pos;

	pos++;

}

void BFS(){

	queue <int> q;

	//queue <int> qb;

	q.push(1);

	color[n] = 1;

	q.push(n);

	color[1] = 0;

	while(!q.empty()){

		//if(!qb.empty()){

			int h = q.front();

			//cout << "B" << h << endl;

			q.pop();

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

				if(color[Edge[i].to] == -1){

					//cout << Edge[i].to << " ";

					color[Edge[i].to] = color[h];

					q.push(Edge[i].to);

				}

			}

			//cout << endl;

		

	}



}

int main(){

	//freopen("input.txt", "r", stdin);

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

		init();

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

			int u, v;

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

			addEdge(u, v);

			addEdge(v, u);

		}

		//cout << n << endl;

		BFS();

		int white = 0, black = 0;

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

			//cout << i << ":"<< color[i] << endl;

			if(color[i] == 1) white++;

			else black++;

		}

		//cout << white <<" "<< black << endl;

		if(white < black) printf("Fennec\n");

		else printf("Snuke\n");

	}

	return 0;

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

#include<cstring>

#include<algorithm>

#include<queue>

#include<vector>

#define mem(a,b) memset(a,b,sizeof(a))

using namespace std;



typedef long long ll;

const int maxn=1e5+5;



vector<int> E[maxn];

int n,col[maxn];

bool vis[maxn];

void bfs(){

	mem(col,0),mem(vis,0);

	queue<int> q;

	q.push(1);vis[1]=1;col[1]=1;

	q.push(n);vis[n]=1;col[n]=2;

	while(!q.empty()){

		int f=q.front();

		q.pop();

		for(auto i:E[f]){

			if(vis[i]) continue;

			col[i]=col[f];

			vis[i]=1;

			q.push(i);

		}

	}

	int t1=0,t2=0;

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

		if(col[i]==1) t1++;

		else if(col[i]==2) t2++;

	}

	if(t1<=t2) puts("Snuke");

	else puts("Fennec");

}

int main(){

	int u,v;

	while(~scanf("%d",&n)){

		for(int i=1;i<=n;i++) E[i].clear();

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

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

			E[u].push_back(v);

			E[v].push_back(u);

		}

		bfs();

	}

	return 0;

}


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

#include <cstring>

#include <queue>

using namespace std;

const int maxn = 1e5 + 10;

const int maxm = 1e5 + 10;

struct edge{

	int to;

	int next;

}Edge[2 * maxm];

int head[maxn], pos, n, color[maxn];

void init(){

	for(int i = 0; i < maxn; i++) head[i] = -1;

	for(int i = 0; i < maxn; i++) color[i] = -1; // -1 is uncolored 1 is whrite, 0 is black

	pos = 0;

}

void addEdge(int u, int v){

	Edge[pos].to = v;

	Edge[pos].next = head[u];

	head[u] = pos;

	pos++;

}

void BFS(){

	queue <int> q;

	//queue <int> qb;

	q.push(1);

	color[n] = 1;

	q.push(n);

	color[1] = 0;

	while(!q.empty()){

		//if(!qb.empty()){

			int h = q.front();

			//cout << "B" << h << endl;

			q.pop();

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

				if(color[Edge[i].to] == -1){

					//cout << Edge[i].to << " ";

					color[Edge[i].to] = color[h];

					q.push(Edge[i].to);

				}

			}

			//cout << endl;

		

	}



}

int main(){

	//freopen("input.txt", "r", stdin);

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

		init();

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

			int u, v;

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

			addEdge(u, v);

			addEdge(v, u);

		}

		//cout << n << endl;

		BFS();

		int white = 0, black = 0;

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

			//cout << i << ":"<< color[i] << endl;

			if(color[i] == 1) white++;

			else black++;

		}

		//cout << white <<" "<< black << endl;

		if(white < black) printf("Fennec\n");

		else printf("Snuke\n");

	}

	return 0;

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

using namespace std;

int n;

vector<int> g[200000];

int d[2][200000],id;

void dfs(int a,int w=-1)

{

    if(w!=-1)

	{

        d[id][a]=d[id][w]+1;

    }

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

	{

    	

        if(g[a][i]!=w)

		{

            dfs(g[a][i],a);

        }

    }

    return;

}

int main()

{

    cin>>n;

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

	{

        int x,y;

        cin>>x>>y;

        x--;

        y--;

        g[x].push_back(y);

        g[y].push_back(x);

    }

    id=0;

    dfs(0);

    id=1;

    dfs(n-1);

    int cnt=0;

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

	{

        if(d[0][i]<=d[1][i])

		{

            cnt++;

        }

    }

    if(cnt>=n/2+1)

	{

       cout<<"Fennec"<<endl;

    }

    else

	{

        cout<<"Snuke"<<endl;

    }

    return 0;

}

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

#define loop(a,b) for((b)=0;(b)<(a);(b)++)

#define append push_back

using namespace std;

vector<long>a[100006];

void dfs(int,int,int,int []);

int main(){

	int black[100006]={},white[100006]={};

	int n,i,j;

	cin>>n;

	n--;

	loop(n,i){

		int x,y;

		cin>>x>>y;

		x--;y--;

		a[x].append(y);

		a[y].append(x);

	}

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

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

	n++;

	int b=0,w=0;

	loop(n,i){

		if(black[i]<=white[i])b++;

		else w++;

	}

	if(b>w)puts("Fennec");

	else puts("Snuke");

	return 0;

}

void dfs(int node,int last,int depth,int graph []){

	graph[node]=depth;

	for(int i=0;i<(int)(a[node].size());i++){

		if(a[node][i]==last)continue;

		dfs(a[node][i],node,depth+1,graph);

	}

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

using namespace std;

int n;

vector<int> g[200000];

int d[2][200000],id;

void dfs(int a,int w=-1)

{

    if(w!=-1)

	{

        d[id][a]=d[id][w]+1;

    }

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

	{

    	

        if(g[a][i]!=w)

		{

            dfs(g[a][i],a);

        }

    }

    return;

}

int main()

{

    cin>>n;

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

	{

        int x,y;

        cin>>x>>y;

        x--;

        y--;

        g[x].push_back(y);

        g[y].push_back(x);

    }

    id=0;

    dfs(0);

    id=1;

    dfs(n-1);

    int cnt=0;

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

	{

        if(d[0][i]<=d[1][i])

		{

            cnt++;

        }

    }

    if(cnt>=n/2+1)

	{

       cout<<"Fennec"<<endl;

    }

    else

	{

        cout<<"Snuke"<<endl;

    }

    return 0;

}

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

#include<cstdio>

#include<algorithm>

#include<vector>

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)

#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)

using namespace std;



int n;

const int Maxd=1e5+7;

vector<int>ch[Maxd],p(Maxd,-1),sz(Maxd,0);



void dfs(int x,vector<int> &p,vector<int> &sz)

{

	sz[x]=1;

	REP(i,ch[x].size())

	{

		if(ch[x][i]!=p[x])

		{

			p[ch[x][i]]=x;

			dfs(ch[x][i],p,sz);

			sz[x]+=sz[ch[x][i]];

		}

	}

}





int main()

{

	cin>>n;

	REP(i,n-1)

	{

		int x;int y;

		cin>>x>>y;

		--x,--y;

		ch[x].push_back(y);

		ch[y].push_back(x);

	}

	dfs(0,p,sz);

	int c=n-1,psz=0;vector<int> path;

	while(c>=0)

	{

		path.push_back(sz[c]-psz);

		psz=sz[c];

		c=p[c];

	}

	int a=0,b=n-1,ls=0,rs=0;

	reverse(path.begin(),path.end());

	REP(i,(path.size()+1)/2)

		ls+=path[i];

	for(int i=(path.size()+1)/2;i<path.size();i++)

		rs+=path[i];

	cout<<(ls<=rs?"Snuke":"Fennec")<<endl;

	return 0;

}