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

using namespace std;

#define ll long long



const int NMAX = 1e5+1;



int parent[NMAX], n;

int subnodes[NMAX];

bool visited[NMAX];

vector<int> adj[NMAX];



void dfs(int node){

	visited[node] = true;

	for(int v : adj[node]){

		if(!visited[v]){

			dfs(v);

			parent[v] = node;

			subnodes[node] += subnodes[v];

		}

	}

	subnodes[node]++;

}



bool ans(){

	vector<int> q;

	int node = n - 1;

	parent[0] = -1;

	while(node != -1){

		q.push_back(node);

		node = parent[node];

	}

	int len = q.size(), fennec = len>>1, i = 0;

	ll a = 0, b = 0;

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

		node = q[i];

		for(int v : adj[node]){

			if((i == 0 ||(i > 0 && q[i-1] != v)) && (i + 1 == len||(i + 1 < len && q[i+1] != v))){

				if(i >= fennec){

					a += subnodes[v];

				}else{

					b += subnodes[v];

				}

			}

		}

	}

	if(len%2 == 0){

		return a > b;

	}else{

		return a >= b;

	}

}



int main()

{

	ios::sync_with_stdio(false);cin.tie(NULL);

	cin >> n;

	int a, b;

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

		cin >> a >> b;

		a--;

		b--;

		adj[a].push_back(b);

		adj[b].push_back(a);

	}

	dfs(0);

	if(ans()){

		cout << "Fennec";

	}else{

		cout << "Snuke";

	}

	return 0;

}




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

#include <bitset>

#include <cmath>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <deque>

#include <list>

#include <map>

#include <iomanip>

#include <iostream>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <utility>

#include <vector>

#define fi first

#define se second

#define pb push_back

//#define mp make_pair

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

using namespace std;

typedef long long LL;

typedef pair<int,int> pii;

const int INF=0x3f3f3f3f;

const int dx[]={0,1,-1,0},dy[]={1,0,0,-1};

//const int MOD=998244353;

const int N=2e5+10;



inline int read(){

	int ww=1,xx=0;char ch=getchar();

	while(!isdigit(ch)){if(ch=='-') ww=-ww;ch=getchar();}

	while(isdigit(ch)){xx=(xx<<1)+(xx<<3)+(ch^48);ch=getchar();}

	return ww*xx;

}



int n;

int num[N];

int q[N];

int head[N];

int cnt,tmp;

bool f;

int ans;



struct Edge{

	int to,nxt;

}ed[N];



void add_edge(int a,int b){

	ed[++cnt].to=b;

	ed[cnt].nxt=head[a];

	head[a]=cnt;

}



void dfs(int u,int p){

//	printf("%d ",u);

	if(!f) q[tmp++]=u;

	if(u==n) f=true;

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

		int v=ed[i].to;

		if(v!=p){

			dfs(v,u);

			num[u]+=num[v]+1;

		}

	}

	if(!f) --tmp;

	return ;

}



signed main(){

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

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

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

	n=read();

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

		int fr,to;

		fr=read();

		to=read();

		add_edge(fr,to);

		add_edge(to,fr);

	}

	tmp=1;

	dfs(1,-1);

//	for(int i=1;i<tmp;i++) printf("%d ",q[i]);

	for(int i=1;i<=tmp/2;i++) ans+=num[q[i]]-num[q[i+1]];

	if(ans>n-ans) puts("Fennec");

	else puts("Snuke");

	return 0;

}

/*

7

3 6

1 2

3 1

7 4

5 7

1 4



4

1 4

4 2

2 3

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

using namespace std;

const int inf=1<<30;

int dist[100010],dist2[100010];

vector<int> g[100010];

void dfs(int now,int par,int d){

	dist[now]=d;

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

		if(g[now][i]!=par){

			dfs(g[now][i],now,d+1);

		}

	}

}

int main(){

	int n;

	cin>>n;

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

		int a,b;

		cin>>a>>b;

		g[a].push_back(b);

		g[b].push_back(a); 

	}

	dfs(n,0,0);

	for(int i=0;i<100010;i++)dist2[i]=dist[i];

	dfs(1,0,0);

	int fec=0,snk=0;

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

		if(dist2[i]>=dist[i])fec++;

		else snk++;

	}

	if(fec>snk)cout<<"Fennec"<<endl;

	else cout<<"Snuke"<<endl;

	return 0;

}

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

#include <bitset>

#include <cmath>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <deque>

#include <list>

#include <map>

#include <iomanip>

#include <iostream>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <utility>

#include <vector>

#define fi first

#define se second

#define pb push_back

//#define mp make_pair

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

using namespace std;

typedef long long LL;

typedef pair<int,int> pii;

const int INF=0x3f3f3f3f;

const int dx[]={0,1,-1,0},dy[]={1,0,0,-1};

//const int MOD=998244353;

const int N=2e5+10;



inline int read(){

	int ww=1,xx=0;char ch=getchar();

	while(!isdigit(ch)){if(ch=='-') ww=-ww;ch=getchar();}

	while(isdigit(ch)){xx=(xx<<1)+(xx<<3)+(ch^48);ch=getchar();}

	return ww*xx;

}



int n;

int num[N];

int q[N];

int head[N];

int cnt,tmp;

bool f;

int ans;



struct Edge{

	int to,nxt;

}ed[N];



void add_edge(int a,int b){

	ed[++cnt].to=b;

	ed[cnt].nxt=head[a];

	head[a]=cnt;

}



void dfs(int u,int p){

//	printf("%d ",u);

	if(!f) q[tmp++]=u;

	if(u==n) f=true;

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

		int v=ed[i].to;

		if(v!=p){

			dfs(v,u);

			num[u]+=num[v]+1;

		}

	}

	if(!f) --tmp;

	return ;

}



signed main(){

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

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

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

	n=read();

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

		int fr,to;

		fr=read();

		to=read();

		add_edge(fr,to);

		add_edge(to,fr);

	}

	tmp=1;

	dfs(1,-1);

//	for(int i=1;i<tmp;i++) printf("%d ",q[i]);

	for(int i=1;i<=tmp/2;i++) ans+=num[q[i]]-num[q[i+1]];

	if(ans>n-ans) puts("Fennec");

	else puts("Snuke");

	return 0;

}

/*

7

3 6

1 2

3 1

7 4

5 7

1 4



4

1 4

4 2

2 3

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

using namespace std;

const int N=100005;

int n,a,b,dep,p,q;

int vis[N],path[N];

vector<int>e[N];

int dfs1(int now,int deep)

{

	vis[now]=1;

	if(now==n)

	{

		dep=deep;

		return 1;

	}

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

	{

		if(vis[e[now][i]])

			continue;

		path[deep]=e[now][i];

		if(dfs1(e[now][i],deep+1))

			return 1;

	}

	return 0;

}

int dfs2(int now)

{

	vis[now]=1;

	int sum=1;

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

		if(!vis[e[now][i]])

			sum+=dfs2(e[now][i]);

	return sum;

}

int main()



{

	scanf("%d",&n);

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

	{

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

		e[a].push_back(b);

		e[b].push_back(a);

	}

	path[0]=1;

	dfs1(1,1);

	//1:(0)---(dep/2),(dep/2+1)---(dep-1)  2:(0)---(dep/2-1),(dep/2)---(dep-1)

 	memset(vis,0,sizeof(vis));

 	p=dfs2(1);

	if(dep%2)

	{

		memset(vis,0,sizeof(vis));

		for(int i=0;i<=dep/2;i++)

			vis[path[i]]=1;

		q=dfs2(path[dep/2+1]);

		if(p-q>q)

			printf("Fennec\n");

		else

			printf("Snuke\n");

	}

	else

	{

		memset(vis,0,sizeof(vis));

		for(int i=0;i<=dep/2-1;i++)

			vis[path[i]]=1;

		q=dfs2(path[dep/2]);

		if(p-q>q)

			printf("Fennec\n");

		else

			printf("Snuke\n");

	}

	return 0;

}


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

#include <bitset>

#include <cmath>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <deque>

#include <list>

#include <map>

#include <iomanip>

#include <iostream>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <utility>

#include <vector>

#define fi first

#define se second

#define pb push_back

//#define mp make_pair

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

using namespace std;

typedef long long LL;

typedef pair<int,int> pii;

const int INF=0x3f3f3f3f;

const int dx[]={0,1,-1,0},dy[]={1,0,0,-1};

//const int MOD=998244353;

const int N=2e5+10;



inline int read(){

	int ww=1,xx=0;char ch=getchar();

	while(!isdigit(ch)){if(ch=='-') ww=-ww;ch=getchar();}

	while(isdigit(ch)){xx=(xx<<1)+(xx<<3)+(ch^48);ch=getchar();}

	return ww*xx;

}



int n;

int num[N];

int q[N];

int head[N];

int cnt,tmp;

bool f;

int ans;



struct Edge{

	int to,nxt;

}ed[N];



void add_edge(int a,int b){

	ed[++cnt].to=b;

	ed[cnt].nxt=head[a];

	head[a]=cnt;

}



void dfs(int u,int p){

//	printf("%d ",u);

	if(!f) q[tmp++]=u;

	if(u==n) f=true;

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

		int v=ed[i].to;

		if(v!=p){

			dfs(v,u);

			num[u]+=num[v]+1;

		}

	}

	if(!f) --tmp;

	return ;

}



signed main(){

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

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

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

	n=read();

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

		int fr,to;

		fr=read();

		to=read();

		add_edge(fr,to);

		add_edge(to,fr);

	}

	tmp=1;

	dfs(1,-1);

//	for(int i=1;i<tmp;i++) printf("%d ",q[i]);

	for(int i=1;i<=tmp/2;i++) ans+=num[q[i]]-num[q[i+1]];

	if(ans>n-ans) puts("Fennec");

	else puts("Snuke");

	return 0;

}

/*

7

3 6

1 2

3 1

7 4

5 7

1 4



4

1 4

4 2

2 3

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

#include <vector>

using namespace std;



int n;

vector<int> pos[100010];

int cnt[100010],l[100010],p[100010];



inline void dfs(int v)

{

	cnt[v]=1;

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

	{

		int cur=pos[v][i];

		if(p[v]==cur) continue;

		l[cur]=l[v]+1;p[cur]=v;

		dfs(cur);

		cnt[v]+=cnt[cur];

	}

}



int main()

{

	cin>>n;

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

	{

		int a,b;

		cin>>a>>b;

		pos[a].push_back(b);

		pos[b].push_back(a);

	}

	

	dfs(1);

	int sz=(l[n]-1)/2,v=n;

	while(sz--) v=p[v];

	if(cnt[v]>=n-cnt[v]) cout<<"Snuke"; else cout<<"Fennec";

	

	return 0;

}

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

using namespace std;

#define SZ(v) ((int)(v).size())

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

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

#define all(v) (v).begin(),(v).end()

typedef long long ll;

typedef unsigned uint;

const int INF=0x3f3f3f3f;

int inline in(){int x=0,c;for(;(uint)((c=getchar())-'0')>=10;)

{if(c=='-')return -in();if(!~c)throw ~0;}do{x=(x<<3)+(x<<1)+(c-'0');}

while((uint)((c=getchar())-'0')<10);return x;}

vector<int> bfs(int n,vector<vector<int> >&G,int s){

	vector<int>d(n,INF);d[s]=0;

	queue<int>q;q.push(s);

	while(!q.empty()){

		int u=q.front();q.pop();

		rep(i,SZ(G[u])){

			int to=G[u][i];

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

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

				q.push(to);

			}

		}

	}

	return d;

}

int main(){

    cin.sync_with_stdio(false);cin.tie(0);

    int n;

	cin>>n;

	vector<vector<int> >G(n);

	rep(i,n-1){

		int a,b;

		cin>>a>>b;

		a--;b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	vector<int>d1=bfs(n,G,0);

	vector<int>d2=bfs(n,G,n-1);

	int n1=0,n2=0;

	rep(i,n){

		if(d1[i]<=d2[i])n1++;

		else n2++;

	}

	string ans=n1>n2?"Fennec":"Snuke";

	cout<<ans<<endl;

	return 0;

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

#include<string>

#include<math.h>

#include<stdlib.h>

#include<set>

#include<bitset>

#include<map>

#include<vector>

#include<string.h>

#include<algorithm>

#include<iostream>

#include<queue>

#include<deque>

#include<stack>

using namespace std;



const int INF=12345678;

int n,par,dist[100005];

vector<int> nei[100005],v;

queue<int> q;



void DFS(int x,int pr){

	dist[x]=1;

	v.push_back(x);

	if(x==n-1){

		par=v[(v.size()+1)/2];

		//return;

	}

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

		int now=nei[x][i];

		if(pr==now) continue;

		DFS(now,x);

		dist[x]+=dist[now];

	}

	v.pop_back();

}



int main(){

	cin>>n;

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

		int x,y;

		cin>>x>>y;

		x--;

		y--;

		nei[x].push_back(y);

		nei[y].push_back(x);

	}

	par=-1;

	DFS(0,0);

	if(dist[par]*2<n) puts("Fennec");

	else puts("Snuke");

	return 0;

}

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

using namespace std;

#define SZ(v) ((int)(v).size())

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

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

#define all(v) (v).begin(),(v).end()

typedef long long ll;

typedef unsigned uint;

const int INF=0x3f3f3f3f;

int inline in(){int x=0,c;for(;(uint)((c=getchar())-'0')>=10;)

{if(c=='-')return -in();if(!~c)throw ~0;}do{x=(x<<3)+(x<<1)+(c-'0');}

while((uint)((c=getchar())-'0')<10);return x;}

vector<int> bfs(int n,vector<vector<int> >&G,int s){

	vector<int>d(n,INF);d[s]=0;

	queue<int>q;q.push(s);

	while(!q.empty()){

		int u=q.front();q.pop();

		rep(i,SZ(G[u])){

			int to=G[u][i];

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

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

				q.push(to);

			}

		}

	}

	return d;

}

int main(){

    cin.sync_with_stdio(false);cin.tie(0);

    int n;

	cin>>n;

	vector<vector<int> >G(n);

	rep(i,n-1){

		int a,b;

		cin>>a>>b;

		a--;b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	vector<int>d1=bfs(n,G,0);

	vector<int>d2=bfs(n,G,n-1);

	int n1=0,n2=0;

	rep(i,n){

		if(d1[i]<=d2[i])n1++;

		else n2++;

	}

	string ans=n1>n2?"Fennec":"Snuke";

	cout<<ans<<endl;

	return 0;

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

#include<cstdio>

#include<algorithm>

#include<queue>

#include<string>

#include<string.h>

#include<memory.h>

#include<vector>

#include<map>

#include<set>

#include<utility>

#include<sstream>

#include<cmath>

#include<list>

#include<deque>

#include<stack>

#include<ctime>

using namespace std;         //一遍dfs，利用nreach,son计算点的个数

vector<int> q;

vector<int> r[100100];

int son[100100];

int nreach,n;

int dfs(int a,int fa)

{q.push_back(a);

son[a]=1;

if(a==n) {nreach=q[(q.size()+1)/2];}

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

								{int nex=r[a][i];

								if(nex==fa) continue;

								son[a]+=dfs(nex,a);

								}

q.pop_back();

return son[a];

}

int main()

{cin>>n;

int a,b;

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

{cin>>a>>b;

r[a].push_back(b);

r[b].push_back(a);

}

int _=dfs(1,-1);

if(son[nreach]<son[1]-son[nreach])  cout<<"Fennec";

else cout<<"Snuke";

return 0;

}


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

using namespace std;

#define SZ(v) ((int)(v).size())

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

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

#define all(v) (v).begin(),(v).end()

typedef long long ll;

typedef unsigned uint;

const int INF=0x3f3f3f3f;

int inline in(){int x=0,c;for(;(uint)((c=getchar())-'0')>=10;)

{if(c=='-')return -in();if(!~c)throw ~0;}do{x=(x<<3)+(x<<1)+(c-'0');}

while((uint)((c=getchar())-'0')<10);return x;}

vector<int> bfs(int n,vector<vector<int> >&G,int s){

	vector<int>d(n,INF);d[s]=0;

	queue<int>q;q.push(s);

	while(!q.empty()){

		int u=q.front();q.pop();

		rep(i,SZ(G[u])){

			int to=G[u][i];

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

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

				q.push(to);

			}

		}

	}

	return d;

}

int main(){

    cin.sync_with_stdio(false);cin.tie(0);

    int n;

	cin>>n;

	vector<vector<int> >G(n);

	rep(i,n-1){

		int a,b;

		cin>>a>>b;

		a--;b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	vector<int>d1=bfs(n,G,0);

	vector<int>d2=bfs(n,G,n-1);

	int n1=0,n2=0;

	rep(i,n){

		if(d1[i]<=d2[i])n1++;

		else n2++;

	}

	string ans=n1>n2?"Fennec":"Snuke";

	cout<<ans<<endl;

	return 0;

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

using namespace std;

#define ll long long



const int NMAX = 1e5+1;



int parent[NMAX], n;

int subnodes[NMAX];

bool visited[NMAX];

vector<int> adj[NMAX];



void dfs(int node){

	visited[node] = true;

	for(int v : adj[node]){

		if(!visited[v]){

			dfs(v);

			parent[v] = node;

			subnodes[node] += subnodes[v];

		}

	}

	subnodes[node]++;

}



bool ans(){

	vector<int> q;

	int node = n - 1;

	parent[0] = -1;

	while(node != -1){

		q.push_back(node);

		node = parent[node];

	}

	int len = q.size(), fennec = len>>1, i = 0;

	ll a = 0, b = 0;

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

		node = q[i];

		for(int v : adj[node]){

			if((i == 0 ||(i > 0 && q[i-1] != v)) && (i + 1 == len||(i + 1 < len && q[i+1] != v))){

				if(i >= fennec){

					a += subnodes[v];

				}else{

					b += subnodes[v];

				}

			}

		}

	}

	if(len%2 == 0){

		return a > b;

	}else{

		return a >= b;

	}

}



int main()

{

	ios::sync_with_stdio(false);cin.tie(NULL);

	cin >> n;

	int a, b;

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

		cin >> a >> b;

		a--;

		b--;

		adj[a].push_back(b);

		adj[b].push_back(a);

	}

	dfs(0);

	if(ans()){

		cout << "Fennec";

	}else{

		cout << "Snuke";

	}

	return 0;

}




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

using namespace std;

#define SZ(v) ((int)(v).size())

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

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

#define all(v) (v).begin(),(v).end()

typedef long long ll;

typedef unsigned uint;

const int INF=0x3f3f3f3f;

int inline in(){int x=0,c;for(;(uint)((c=getchar())-'0')>=10;)

{if(c=='-')return -in();if(!~c)throw ~0;}do{x=(x<<3)+(x<<1)+(c-'0');}

while((uint)((c=getchar())-'0')<10);return x;}

vector<int> bfs(int n,vector<vector<int> >&G,int s){

	vector<int>d(n,INF);d[s]=0;

	queue<int>q;q.push(s);

	while(!q.empty()){

		int u=q.front();q.pop();

		rep(i,SZ(G[u])){

			int to=G[u][i];

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

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

				q.push(to);

			}

		}

	}

	return d;

}

int main(){

    cin.sync_with_stdio(false);cin.tie(0);

    int n;

	cin>>n;

	vector<vector<int> >G(n);

	rep(i,n-1){

		int a,b;

		cin>>a>>b;

		a--;b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	vector<int>d1=bfs(n,G,0);

	vector<int>d2=bfs(n,G,n-1);

	int n1=0,n2=0;

	rep(i,n){

		if(d1[i]<=d2[i])n1++;

		else n2++;

	}

	string ans=n1>n2?"Fennec":"Snuke";

	cout<<ans<<endl;

	return 0;

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

using namespace std;

const int inf=1<<30;

int dist[100010],dist2[100010];

vector<int> g[100010];

void dfs(int now,int par,int d){

	dist[now]=d;

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

		if(g[now][i]!=par){

			dfs(g[now][i],now,d+1);

		}

	}

}

int main(){

	int n;

	cin>>n;

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

		int a,b;

		cin>>a>>b;

		g[a].push_back(b);

		g[b].push_back(a); 

	}

	dfs(n,0,0);

	for(int i=0;i<100010;i++)dist2[i]=dist[i];

	dfs(1,0,0);

	int fec=0,snk=0;

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

		if(dist2[i]>=dist[i])fec++;

		else snk++;

	}

	if(fec>snk)cout<<"Fennec"<<endl;

	else cout<<"Snuke"<<endl;

	return 0;

}

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

using namespace std;

#define SZ(v) ((int)(v).size())

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

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

#define all(v) (v).begin(),(v).end()

typedef long long ll;

typedef unsigned uint;

const int INF=0x3f3f3f3f;

int inline in(){int x=0,c;for(;(uint)((c=getchar())-'0')>=10;)

{if(c=='-')return -in();if(!~c)throw ~0;}do{x=(x<<3)+(x<<1)+(c-'0');}

while((uint)((c=getchar())-'0')<10);return x;}

vector<int> bfs(int n,vector<vector<int> >&G,int s){

	vector<int>d(n,INF);d[s]=0;

	queue<int>q;q.push(s);

	while(!q.empty()){

		int u=q.front();q.pop();

		rep(i,SZ(G[u])){

			int to=G[u][i];

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

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

				q.push(to);

			}

		}

	}

	return d;

}

int main(){

    cin.sync_with_stdio(false);cin.tie(0);

    int n;

	cin>>n;

	vector<vector<int> >G(n);

	rep(i,n-1){

		int a,b;

		cin>>a>>b;

		a--;b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	vector<int>d1=bfs(n,G,0);

	vector<int>d2=bfs(n,G,n-1);

	int n1=0,n2=0;

	rep(i,n){

		if(d1[i]<=d2[i])n1++;

		else n2++;

	}

	string ans=n1>n2?"Fennec":"Snuke";

	cout<<ans<<endl;

	return 0;

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

using namespace std;

const int N=100005;

int n,a,b,dep,p,q;

int vis[N],path[N];

vector<int>e[N];

int dfs1(int now,int deep)

{

	vis[now]=1;

	if(now==n)

	{

		dep=deep;

		return 1;

	}

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

	{

		if(vis[e[now][i]])

			continue;

		path[deep]=e[now][i];

		if(dfs1(e[now][i],deep+1))

			return 1;

	}

	return 0;

}

int dfs2(int now)

{

	vis[now]=1;

	int sum=1;

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

		if(!vis[e[now][i]])

			sum+=dfs2(e[now][i]);

	return sum;

}

int main()



{

	scanf("%d",&n);

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

	{

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

		e[a].push_back(b);

		e[b].push_back(a);

	}

	path[0]=1;

	dfs1(1,1);

	//1:(0)---(dep/2),(dep/2+1)---(dep-1)  2:(0)---(dep/2-1),(dep/2)---(dep-1)

 	memset(vis,0,sizeof(vis));

 	p=dfs2(1);

	if(dep%2)

	{

		memset(vis,0,sizeof(vis));

		for(int i=0;i<=dep/2;i++)

			vis[path[i]]=1;

		q=dfs2(path[dep/2+1]);

		if(p-q>q)

			printf("Fennec\n");

		else

			printf("Snuke\n");

	}

	else

	{

		memset(vis,0,sizeof(vis));

		for(int i=0;i<=dep/2-1;i++)

			vis[path[i]]=1;

		q=dfs2(path[dep/2]);

		if(p-q>q)

			printf("Fennec\n");

		else

			printf("Snuke\n");

	}

	return 0;

}


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

using namespace std;

#define SZ(v) ((int)(v).size())

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

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

#define all(v) (v).begin(),(v).end()

typedef long long ll;

typedef unsigned uint;

const int INF=0x3f3f3f3f;

int inline in(){int x=0,c;for(;(uint)((c=getchar())-'0')>=10;)

{if(c=='-')return -in();if(!~c)throw ~0;}do{x=(x<<3)+(x<<1)+(c-'0');}

while((uint)((c=getchar())-'0')<10);return x;}

vector<int> bfs(int n,vector<vector<int> >&G,int s){

	vector<int>d(n,INF);d[s]=0;

	queue<int>q;q.push(s);

	while(!q.empty()){

		int u=q.front();q.pop();

		rep(i,SZ(G[u])){

			int to=G[u][i];

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

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

				q.push(to);

			}

		}

	}

	return d;

}

int main(){

    cin.sync_with_stdio(false);cin.tie(0);

    int n;

	cin>>n;

	vector<vector<int> >G(n);

	rep(i,n-1){

		int a,b;

		cin>>a>>b;

		a--;b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	vector<int>d1=bfs(n,G,0);

	vector<int>d2=bfs(n,G,n-1);

	int n1=0,n2=0;

	rep(i,n){

		if(d1[i]<=d2[i])n1++;

		else n2++;

	}

	string ans=n1>n2?"Fennec":"Snuke";

	cout<<ans<<endl;

	return 0;

}