stablegradients/pie-gem5-pairs huggingface dataset:
// 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;

vector<int> nei[100005];

int dis[100005],rdis[100005];

void bfs(int start,int d[]){

	fill(d,d+100005,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);

			}

		}

	}

}

int main(){

	scanf("%d",&n);

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

		int a,b;

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

		a--;

		b--;

		nei[a].push_back(b);

		nei[b].push_back(a);

	}

	bfs(0,dis);

	bfs(n-1,rdis);

	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.2375071551241985x):
#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;

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

#include <stdio.h>

#include <string.h>

#include <algorithm>

#include <vector>

using namespace std;

#define LL long long

#define MX 100010

  

int n;

int total;

vector<int> G[MX];

int colr[MX];



void DFS(int x,int pre,int c,int &tot)

{

    if (colr[x]==-c) return;

    tot++;

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

       if (G[x][i]!=pre)

            DFS(G[x][i],x,c,tot);

}



void dfs(int u,int pre,int s,int &ok)

{

    if (u==n)

    {

        ok=s;

        return;

    }

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

    {

        if (ok) break;

        if (G[u][i]!=pre)

            dfs(G[u][i],u,s+1,ok);

    }

    if (ok)

    {

        if (u!=1&&s<=ok/2) colr[u]=1;

        if (u!=n&&s>ok/2) colr[u]=-1;

    }

    return;

}

int main()

{

    scanf("%d",&n);

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

    {

        int u,v;

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

        G[u].push_back(v);

        G[v].push_back(u);

    }

    colr[1]=1; //hei

    colr[n]=-1;//bai



    int ok=0;

    dfs(1,-10,0,ok);





    int num_1=0;

    DFS(1,-10,1,num_1);

    int num_2=0;

    DFS(n,-10,-1,num_2);

    if (num_1-num_2>=1)

        printf("Fennec\n");

    else

        printf("Snuke\n");

    return 0;

}

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

int d[2][100010],w=0;

int ta[100010],to[200010],nt[200010];

void f(int s){

  int i,j,t,r,q[100010];

  d[w][q[t=0]=s]=1;

  for(r=1;r-t;t++){

    for(i=ta[q[t]];i+1;i=nt[i]){

      if(d[w][to[i]])continue;

      d[w][to[i]]=d[w][q[t]]+1;

      q[r++]=to[i];

    }

  }

}

int main(){

  int n,a,b,i;

  scanf("%d",&n);

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

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

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

    nt[i    ]=ta[to[i+n]=a];

    nt[i+n  ]=ta[to[i  ]=b];

    ta[a]=i;

    ta[b]=i+n;

  }

  f(1);

  w++;//for(i=1;i<=n;i++)printf("%d %d\n",d[0][i],d[1][i]);

  f(n);

  for(i=a=b=0;i<n;i++){

    if(d[0][i+1]>d[1][i+1])b++;

    else a++;

  }

  //for(i=1;i<=n;i++)printf("%d %d\n",d[0][i],d[1][i]);

  printf("%s\n",b<a?"Fennec":"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;

vector<int> nei[100005];

int dis[100005],rdis[100005];

void bfs(int start,int d[]){

	fill(d,d+100005,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);

			}

		}

	}

}

int main(){

	scanf("%d",&n);

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

		int a,b;

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

		a--;

		b--;

		nei[a].push_back(b);

		nei[b].push_back(a);

	}

	bfs(0,dis);

	bfs(n-1,rdis);

	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: 21.83856642255186x):
#include<stdio.h>

int d[2][100010],w=0;

int ta[100010],to[200010],nt[200010];

void f(int s){

  int i,j,t,r,q[100010];

  d[w][q[t=0]=s]=1;

  for(r=1;r-t;t++){

    for(i=ta[q[t]];i+1;i=nt[i]){

      if(d[w][to[i]])continue;

      d[w][to[i]]=d[w][q[t]]+1;

      q[r++]=to[i];

    }

  }

}

int main(){

  int n,a,b,i;

  scanf("%d",&n);

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

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

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

    nt[i    ]=ta[to[i+n]=a];

    nt[i+n  ]=ta[to[i  ]=b];

    ta[a]=i;

    ta[b]=i+n;

  }

  f(1);

  w++;//for(i=1;i<=n;i++)printf("%d %d\n",d[0][i],d[1][i]);

  f(n);

  for(i=a=b=0;i<n;i++){

    if(d[0][i+1]>d[1][i+1])b++;

    else a++;

  }

  //for(i=1;i<=n;i++)printf("%d %d\n",d[0][i],d[1][i]);

  printf("%s\n",b<a?"Fennec":"Snuke");

  return 0;

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

#include <algorithm>

#include <cstring>

#include <cstdio>

using namespace std;

const int MAXN=1e5+10;

int num1[MAXN],num2[MAXN];

int T,n;

int head[MAXN],net[2*MAXN],u[2*MAXN],v[2*MAXN],tot;

int read()

{

	int f=0,w=1; char ch=getchar();

	while(ch<'0'||ch>'9') { if(ch=='-') w=-1; ch=getchar(); }

	while(ch>='0'&&ch<='9') { f=(f<<3)+(f<<1)+ch-'0'; ch=getchar(); }

	return f*w;

}

void add(int l,int r)

{

	u[++tot]=l; v[tot]=r; net[tot]=head[l]; head[l]=tot;

}

int vt[MAXN];

void dfs(int now,int step,int flag)

{

	vt[now]=1; 

	if(flag==1) num1[now]=step;

	if(flag==2) num2[now]=step;

	for(int i=head[now];i;i=net[i])

		if(vt[v[i]]==0)

			dfs(v[i],step+1,flag);

}

int main()

{

	//freopen("T3.in","r",stdin);

	//freopen("T3.out","w",stdout);

	T=1;

	while(T--)

	{

		n=read(); tot=0;

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

		memset(net,0,sizeof(net));

		memset(u,0,sizeof(u));

		memset(v,0,sizeof(v));

		memset(num1,0,sizeof(num1));

		memset(num2,0,sizeof(num2));

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

		{

			int l=read(),r=read();

			add(l,r);

			add(r,l);

		}

		memset(vt,0,sizeof(vt));

		dfs(1,0,1);

		memset(vt,0,sizeof(vt));

		dfs(n,0,2);

		int p1=0,p2=0;

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

		{

			if(num1[i]<num2[i])

				p1++;

			if(num2[i]<num1[i])

				p2++;

			if(num1[i]==num2[i])

				p1++;

		}

		if(p1>p2) printf("Fennec\n");

		else printf("Snuke\n");

	}

}

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

int d[2][100010],w=0;

int ta[100010],to[200010],nt[200010];

void f(int s){

  int i,j,t,r,q[100010];

  d[w][q[t=0]=s]=1;

  for(r=1;r-t;t++){

    for(i=ta[q[t]];i+1;i=nt[i]){

      if(d[w][to[i]])continue;

      d[w][to[i]]=d[w][q[t]]+1;

      q[r++]=to[i];

    }

  }

}

int main(){

  int n,a,b,i;

  scanf("%d",&n);

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

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

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

    nt[i    ]=ta[to[i+n]=a];

    nt[i+n  ]=ta[to[i  ]=b];

    ta[a]=i;

    ta[b]=i+n;

  }

  f(1);

  w++;//for(i=1;i<=n;i++)printf("%d %d\n",d[0][i],d[1][i]);

  f(n);

  for(i=a=b=0;i<n;i++){

    if(d[0][i+1]>d[1][i+1])b++;

    else a++;

  }

  //for(i=1;i<=n;i++)printf("%d %d\n",d[0][i],d[1][i]);

  printf("%s\n",b<a?"Fennec":"Snuke");

  return 0;

}
// 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: 17.647224367248285x):
#include<stdio.h>

int d[2][100010],w=0;

int ta[100010],to[200010],nt[200010];

void f(int s){

  int i,j,t,r,q[100010];

  d[w][q[t=0]=s]=1;

  for(r=1;r-t;t++){

    for(i=ta[q[t]];i+1;i=nt[i]){

      if(d[w][to[i]])continue;

      d[w][to[i]]=d[w][q[t]]+1;

      q[r++]=to[i];

    }

  }

}

int main(){

  int n,a,b,i;

  scanf("%d",&n);

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

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

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

    nt[i    ]=ta[to[i+n]=a];

    nt[i+n  ]=ta[to[i  ]=b];

    ta[a]=i;

    ta[b]=i+n;

  }

  f(1);

  w++;//for(i=1;i<=n;i++)printf("%d %d\n",d[0][i],d[1][i]);

  f(n);

  for(i=a=b=0;i<n;i++){

    if(d[0][i+1]>d[1][i+1])b++;

    else a++;

  }

  //for(i=1;i<=n;i++)printf("%d %d\n",d[0][i],d[1][i]);

  printf("%s\n",b<a?"Fennec":"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;

vector<int> nei[100005];

int dis[100005],rdis[100005];

void bfs(int start,int d[]){

	fill(d,d+100005,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);

			}

		}

	}

}

int main(){

	scanf("%d",&n);

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

		int a,b;

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

		a--;

		b--;

		nei[a].push_back(b);

		nei[b].push_back(a);

	}

	bfs(0,dis);

	bfs(n-1,rdis);

	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.2369511356130702x):
#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;}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <cstring>

#include <cstdio>

using namespace std;

const int MAXN=1e5+10;

int num1[MAXN],num2[MAXN];

int T,n;

int head[MAXN],net[2*MAXN],u[2*MAXN],v[2*MAXN],tot;

int read()

{

	int f=0,w=1; char ch=getchar();

	while(ch<'0'||ch>'9') { if(ch=='-') w=-1; ch=getchar(); }

	while(ch>='0'&&ch<='9') { f=(f<<3)+(f<<1)+ch-'0'; ch=getchar(); }

	return f*w;

}

void add(int l,int r)

{

	u[++tot]=l; v[tot]=r; net[tot]=head[l]; head[l]=tot;

}

int vt[MAXN];

void dfs(int now,int step,int flag)

{

	vt[now]=1; 

	if(flag==1) num1[now]=step;

	if(flag==2) num2[now]=step;

	for(int i=head[now];i;i=net[i])

		if(vt[v[i]]==0)

			dfs(v[i],step+1,flag);

}

int main()

{

	//freopen("T3.in","r",stdin);

	//freopen("T3.out","w",stdout);

	T=1;

	while(T--)

	{

		n=read(); tot=0;

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

		memset(net,0,sizeof(net));

		memset(u,0,sizeof(u));

		memset(v,0,sizeof(v));

		memset(num1,0,sizeof(num1));

		memset(num2,0,sizeof(num2));

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

		{

			int l=read(),r=read();

			add(l,r);

			add(r,l);

		}

		memset(vt,0,sizeof(vt));

		dfs(1,0,1);

		memset(vt,0,sizeof(vt));

		dfs(n,0,2);

		int p1=0,p2=0;

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

		{

			if(num1[i]<num2[i])

				p1++;

			if(num2[i]<num1[i])

				p2++;

			if(num1[i]==num2[i])

				p1++;

		}

		if(p1>p2) printf("Fennec\n");

		else printf("Snuke\n");

	}

}

// Faster C++ solution for the same problem (measured speedup: 1.434688215042904x):
#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;}
// Slower C++ solution:
#include <iostream>

#include <stdio.h>

#include <string.h>

#include <algorithm>

#include <vector>

using namespace std;

#define LL long long

#define MX 100010

  

int n;

int total;

vector<int> G[MX];

int colr[MX];



void DFS(int x,int pre,int c,int &tot)

{

    if (colr[x]==-c) return;

    tot++;

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

       if (G[x][i]!=pre)

            DFS(G[x][i],x,c,tot);

}



void dfs(int u,int pre,int s,int &ok)

{

    if (u==n)

    {

        ok=s;

        return;

    }

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

    {

        if (ok) break;

        if (G[u][i]!=pre)

            dfs(G[u][i],u,s+1,ok);

    }

    if (ok)

    {

        if (u!=1&&s<=ok/2) colr[u]=1;

        if (u!=n&&s>ok/2) colr[u]=-1;

    }

    return;

}

int main()

{

    scanf("%d",&n);

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

    {

        int u,v;

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

        G[u].push_back(v);

        G[v].push_back(u);

    }

    colr[1]=1; //hei

    colr[n]=-1;//bai



    int ok=0;

    dfs(1,-10,0,ok);





    int num_1=0;

    DFS(1,-10,1,num_1);

    int num_2=0;

    DFS(n,-10,-1,num_2);

    if (num_1-num_2>=1)

        printf("Fennec\n");

    else

        printf("Snuke\n");

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.5404724915194787x):
#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 <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;

vector<int> nei[100005];

int dis[100005],rdis[100005];

void bfs(int start,int d[]){

	fill(d,d+100005,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);

			}

		}

	}

}

int main(){

	scanf("%d",&n);

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

		int a,b;

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

		a--;

		b--;

		nei[a].push_back(b);

		nei[b].push_back(a);

	}

	bfs(0,dis);

	bfs(n-1,rdis);

	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: 3.156578924305012x):
#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 <iostream>

#include <algorithm>

#include <cstring>

#include <cstdio>

using namespace std;

const int MAXN=1e5+10;

int num1[MAXN],num2[MAXN];

int T,n;

int head[MAXN],net[2*MAXN],u[2*MAXN],v[2*MAXN],tot;

int read()

{

	int f=0,w=1; char ch=getchar();

	while(ch<'0'||ch>'9') { if(ch=='-') w=-1; ch=getchar(); }

	while(ch>='0'&&ch<='9') { f=(f<<3)+(f<<1)+ch-'0'; ch=getchar(); }

	return f*w;

}

void add(int l,int r)

{

	u[++tot]=l; v[tot]=r; net[tot]=head[l]; head[l]=tot;

}

int vt[MAXN];

void dfs(int now,int step,int flag)

{

	vt[now]=1; 

	if(flag==1) num1[now]=step;

	if(flag==2) num2[now]=step;

	for(int i=head[now];i;i=net[i])

		if(vt[v[i]]==0)

			dfs(v[i],step+1,flag);

}

int main()

{

	//freopen("T3.in","r",stdin);

	//freopen("T3.out","w",stdout);

	T=1;

	while(T--)

	{

		n=read(); tot=0;

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

		memset(net,0,sizeof(net));

		memset(u,0,sizeof(u));

		memset(v,0,sizeof(v));

		memset(num1,0,sizeof(num1));

		memset(num2,0,sizeof(num2));

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

		{

			int l=read(),r=read();

			add(l,r);

			add(r,l);

		}

		memset(vt,0,sizeof(vt));

		dfs(1,0,1);

		memset(vt,0,sizeof(vt));

		dfs(n,0,2);

		int p1=0,p2=0;

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

		{

			if(num1[i]<num2[i])

				p1++;

			if(num2[i]<num1[i])

				p2++;

			if(num1[i]==num2[i])

				p1++;

		}

		if(p1>p2) printf("Fennec\n");

		else printf("Snuke\n");

	}

}

// Faster C++ solution for the same problem (measured speedup: 3.661184708245281x):
#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;

}