stablegradients/pie-gem5-pairs huggingface dataset:
// 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: 19.00304410361464x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define MN 100005

using namespace std;

inline int in(){

    int x=0;bool f=0;char c;

    for (;(c=getchar())<'0'||c>'9';f=c=='-');

    for (x=c-'0';(c=getchar())>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0');

    return f?-x:x;

}

struct edge{

	int to,nxt;

}e[MN<<1];

int h[MN],dep[MN],fa[MN],siz[MN];

int n,x,y,cnt,d;

inline void ins(int x,int y){

	e[++cnt].to=y;e[cnt].nxt=h[x];h[x]=cnt;

}

inline void dfs(int u){

	siz[u]=1;

	for (int i=h[u];i;i=e[i].nxt){

		int v=e[i].to;

		if (v==fa[u]) continue;

		dep[v]=dep[u]+1;fa[v]=u;

		dfs(v);siz[u]+=siz[v];

	}

}

int main()

{

	n=in();

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

		x=in();y=in();

		ins(x,y);ins(y,x);

	}fa[n]=0;dep[n]=1;dfs(n);d=(dep[1]>>1)+1;

	for (int i=1;i;i=fa[i])

	if (dep[i]==d){

		printf((siz[i]>n-siz[i])?"Fennec":"Snuke");return 0;

	}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: 18.9764141085965x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define MN 100005

using namespace std;

inline int in(){

    int x=0;bool f=0;char c;

    for (;(c=getchar())<'0'||c>'9';f=c=='-');

    for (x=c-'0';(c=getchar())>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0');

    return f?-x:x;

}

struct edge{

	int to,nxt;

}e[MN<<1];

int h[MN],dep[MN],fa[MN],siz[MN];

int n,x,y,cnt,d;

inline void ins(int x,int y){

	e[++cnt].to=y;e[cnt].nxt=h[x];h[x]=cnt;

}

inline void dfs(int u){

	siz[u]=1;

	for (int i=h[u];i;i=e[i].nxt){

		int v=e[i].to;

		if (v==fa[u]) continue;

		dep[v]=dep[u]+1;fa[v]=u;

		dfs(v);siz[u]+=siz[v];

	}

}

int main()

{

	n=in();

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

		x=in();y=in();

		ins(x,y);ins(y,x);

	}fa[n]=0;dep[n]=1;dfs(n);d=(dep[1]>>1)+1;

	for (int i=1;i;i=fa[i])

	if (dep[i]==d){

		printf((siz[i]>n-siz[i])?"Fennec":"Snuke");return 0;

	}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: 19.005865277203714x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define MN 100005

using namespace std;

inline int in(){

    int x=0;bool f=0;char c;

    for (;(c=getchar())<'0'||c>'9';f=c=='-');

    for (x=c-'0';(c=getchar())>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0');

    return f?-x:x;

}

struct edge{

	int to,nxt;

}e[MN<<1];

int h[MN],dep[MN],fa[MN],siz[MN];

int n,x,y,cnt,d;

inline void ins(int x,int y){

	e[++cnt].to=y;e[cnt].nxt=h[x];h[x]=cnt;

}

inline void dfs(int u){

	siz[u]=1;

	for (int i=h[u];i;i=e[i].nxt){

		int v=e[i].to;

		if (v==fa[u]) continue;

		dep[v]=dep[u]+1;fa[v]=u;

		dfs(v);siz[u]+=siz[v];

	}

}

int main()

{

	n=in();

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

		x=in();y=in();

		ins(x,y);ins(y,x);

	}fa[n]=0;dep[n]=1;dfs(n);d=(dep[1]>>1)+1;

	for (int i=1;i;i=fa[i])

	if (dep[i]==d){

		printf((siz[i]>n-siz[i])?"Fennec":"Snuke");return 0;

	}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: 19.16929228094566x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#define MN 100005

using namespace std;

inline int in(){

    int x=0;bool f=0;char c;

    for (;(c=getchar())<'0'||c>'9';f=c=='-');

    for (x=c-'0';(c=getchar())>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0');

    return f?-x:x;

}

struct edge{

	int to,nxt;

}e[MN<<1];

int h[MN],dep[MN],fa[MN],siz[MN];

int n,x,y,cnt,d;

inline void ins(int x,int y){

	e[++cnt].to=y;e[cnt].nxt=h[x];h[x]=cnt;

}

inline void dfs(int u){

	siz[u]=1;

	for (int i=h[u];i;i=e[i].nxt){

		int v=e[i].to;

		if (v==fa[u]) continue;

		dep[v]=dep[u]+1;fa[v]=u;

		dfs(v);siz[u]+=siz[v];

	}

}

int main()

{

	n=in();

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

		x=in();y=in();

		ins(x,y);ins(y,x);

	}fa[n]=0;dep[n]=1;dfs(n);d=(dep[1]>>1)+1;

	for (int i=1;i;i=fa[i])

	if (dep[i]==d){

		printf((siz[i]>n-siz[i])?"Fennec":"Snuke");return 0;

	}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: 1.2311632652296063x):
#include<iostream>

#include<algorithm>

#include<string>

#include<functional>

#include<utility>

#include<ctime>

#include<cmath>

#include<vector>

#include<set>

#include<queue>

#include<deque>

#include<map>

#include<cstring>

#include<stack>

#include<cctype>

#include<cstdio>

#include<bitset>

#ifdef LOCAL

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

	#define tri(x) x*(x+1)/2;

	#define sqrsum(x) x*(x+1)*(2*x+1)/6;

	#define sqrsum_range(a,b) sqrsum(b)-sqrsum(a-1);

#endif

#define FOR(i,a,b) for(int i=a,_b=b;i<_b;i++)

#define REP(i,a,b) FOR(i,a,b+1)

#define ll_max 9223372036854775807LL

#define ll_min -9223372036854775808LL

#define int_max 2147483647

#define int_min -2147483648

#define PI 3.141592653589793238462653383

#define eps 0.00000001

#define elif else if

using namespace std;

void fast()

{

	cin.tie(NULL);

	cout.tie(NULL);

	ios_base::sync_with_stdio(false);

	return ;

}

bool isprime(int x)

{

	if(x<2)

		return false;

	for(int i=2;i<=sqrt(x);i++)

		if(x%i==0)

			return false;

	return true;

}

int GCD(int a,int b)

{

	return (b?GCD(b,a%b):a);

}

struct Tm

{

	int h,m,s;

	bool add()

	{

		s++;

		if(s==60)

			m++,

			s=0;

		if(m==60)

			h++,

			m=0;

		return (h<100);

	}

	void print()

	{

		printf("%02d:%02d:%02d",h,m,s);

		return ;

	}

	void println()

	{

		print();

		puts("");

	}

};

vector<int> G[100100];

int dist[100100][2];

void dfs(int now,int pre,int x)

{

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

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

		{

			dist[G[now][i]][x]=dist[now][x]+1;

			dfs(G[now][i],now,x);

		}

	return ;

}

int main()

{

	int N;

	cin>>N;

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

	{

		int a,b;

		cin>>a>>b;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(1,0,0);

	dfs(N,0,1);

	int cnt1=0,cnt2=0;

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

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

			cnt1++;

		else	cnt2++;

	if(cnt2>=cnt1)

		puts("Snuke");

	else	puts("Fennec");

	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: 1.2270608049537806x):
//Author:Barry Wang

#include <bits/stdc++.h>

using namespace std;

/*---define tricks---*/

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

#define UN(v) sort(ALL(v)),v.erase(unique(ALL(v)),v.end())

#define FILL(x,y) memset(x,y,sizeof(x))

#define EACH(v,it) for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)

#define FIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)

#define revsort(b,e) sort(b,e),reverse(b,e)

#define X first

#define Y second

/*---define types---*/

typedef long long ll;

typedef list<int> li;

typedef queue<int> qi;

typedef deque<int> dqi;

typedef vector<int> vi;

typedef pair<int,int> pii;

typedef vector<pii> vii;

typedef pair<ll,ll> pll;

typedef pair<ll,int> pli;

typedef unsigned int uint;

/*---define variables---*/

const int inf=(1<<29);

int n;

vi E[100005];

int dis[100005][2];

/*---define function---*/



void DFS(int x,const int& pre,const int& num)

{

	EACH(E[x],it)

	{

		int y=*it;

		if(y!=pre)

		{

			dis[y][num]=dis[x][num]+1;

			DFS(y,x,num);

		}

	}

}



/*---main code---*/

int main()

{

	FIO;

	cin>>n;

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

	{

		int x,y;

		cin>>x>>y;

		E[x].push_back(y);

		E[y].push_back(x);

	}

	DFS(1,-1,0);

	DFS(n,-1,1);

	int cntf=0,cnts=0;

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

	{

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

		{

			cntf++;

		}

		else

		{

			cnts++;

		}

	}

	if(cntf>cnts)

	{

		puts("Fennec");

	}

	else

	{

		puts("Snuke");

	}

	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: 1.117925186416142x):
//Author:Barry Wang

#include <bits/stdc++.h>

using namespace std;

/*---define tricks---*/

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

#define UN(v) sort(ALL(v)),v.erase(unique(ALL(v)),v.end())

#define FILL(x,y) memset(x,y,sizeof(x))

#define EACH(v,it) for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)

#define FIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)

#define revsort(b,e) sort(b,e),reverse(b,e)

#define X first

#define Y second

/*---define types---*/

typedef long long ll;

typedef list<int> li;

typedef queue<int> qi;

typedef deque<int> dqi;

typedef vector<int> vi;

typedef pair<int,int> pii;

typedef vector<pii> vii;

typedef pair<ll,ll> pll;

typedef pair<ll,int> pli;

typedef unsigned int uint;

/*---define variables---*/

const int inf=(1<<29);

int n;

vi E[100005];

int dis[100005][2];

/*---define function---*/



void DFS(int x,const int& pre,const int& num)

{

	EACH(E[x],it)

	{

		int y=*it;

		if(y!=pre)

		{

			dis[y][num]=dis[x][num]+1;

			DFS(y,x,num);

		}

	}

}



/*---main code---*/

int main()

{

	FIO;

	cin>>n;

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

	{

		int x,y;

		cin>>x>>y;

		E[x].push_back(y);

		E[y].push_back(x);

	}

	DFS(1,-1,0);

	DFS(n,-1,1);

	int cntf=0,cnts=0;

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

	{

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

		{

			cntf++;

		}

		else

		{

			cnts++;

		}

	}

	if(cntf>cnts)

	{

		puts("Fennec");

	}

	else

	{

		puts("Snuke");

	}

	return 0;

}
// 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: 1.9826113924851494x):
#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<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: 1.9798330517510587x):
#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<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: 1.9829057290591938x):
#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

*/