stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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;

}




// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
//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;

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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

*/

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <vector>

#include <queue>

using namespace std;



inline vector<int> bfs(int n,vector<vector<int> > &g,int s)

{

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

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

	while(!q.empty())

	{

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

		for(auto v:g[cur])

			if(d[v]>d[cur]+1)

			{

				d[v]=d[cur]+1;

				q.push(v);

			}

	}

	return d;

}



int main()

{

	int n;

	cin>>n;

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

	

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

	{

		int a,b;

		cin>>a>>b;

		a--;b--;

		g[a].push_back(b);g[b].push_back(a);

	}

	

	vector<int> a=bfs(n,g,0);

	vector<int> b=bfs(n,g,n-1);

	

	int f=0,s=0;

	for(int i=0;i<n;i++) if(a[i]<=b[i]) f++; else s++;

	cout<<(f>s?"Fennec":"Snuke");

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <vector>

using namespace std;



int n;

vector<int> pos[100010],vct;

int cnt[100010],first;



inline void dfs(int v,int pr)

{

	cnt[v]=1;

	vct.push_back(v);

	

	if(v==n-1) first=vct[(vct.size()+1)/2];

	

	for(auto to:pos[v])

	{

		if(to==pr) continue;

		dfs(to,v);

		cnt[v]+=cnt[to];

	}

	vct.pop_back();

}



int main()

{

	cin>>n;

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

	{

		int a,b;

		cin>>a>>b;

		a--;b--;

		pos[a].push_back(b);

		pos[b].push_back(a);

	}

	

	first=-1;

	dfs(0,0);

	cout<<(cnt[first]*2<n?"Fennec":"Snuke");

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <vector>

#include <queue>

using namespace std;



inline vector<int> bfs(int n,vector<vector<int> > &g,int s)

{

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

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

	while(!q.empty())

	{

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

		for(auto v:g[cur])

			if(d[v]>d[cur]+1)

			{

				d[v]=d[cur]+1;

				q.push(v);

			}

	}

	return d;

}



int main()

{

	int n;

	cin>>n;

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

	

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

	{

		int a,b;

		cin>>a>>b;

		a--;b--;

		g[a].push_back(b);g[b].push_back(a);

	}

	

	vector<int> a=bfs(n,g,0);

	vector<int> b=bfs(n,g,n-1);

	

	int f=0,s=0;

	for(int i=0;i<n;i++) if(a[i]<=b[i]) f++; else s++;

	cout<<(f>s?"Fennec":"Snuke");

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
/* long long or int & the MAX_INT or MIN_INT */

/* the size of a[] & inline */

/* xx 396 */



#include<bits/stdc++.h>

using namespace std;



const int MAX_N=1e5+10;



vector <int> G[MAX_N],Main,now;

int col[MAX_N],N;



inline void dfs(int at,int p){

	now.push_back(at);

	if(at==N-1) Main=now;

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

		int to=G[at][i];

		if(to!=p) dfs(to,at);

	}

	now.resize(now.size()-1);

}



inline void color(int at,int p){

	int c=col[at];

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

		int to=G[at][i];

		if(col[to]==-1) col[to]=c;

		if(to!=p) color(to,at);

	}

}



signed main(){

	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	for(int i=0;i<MAX_N;i++) col[i]=-1;

	cin>>N;

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

		int a,b; cin>>a>>b; a--; b--;

		G[a].push_back(b); G[b].push_back(a);

	}	

	dfs(0,-1);

	for(int i=0;i<(Main.size()+1)/2;i++) col[Main[i]]=1;

	for(int i=(Main.size()+1)/2;i<Main.size();i++) col[Main[i]]=0;

	color(0,-1);

	int sum1=0,sum2=0;

	for(int i=0;i<N;i++) if(col[i]==1) sum1++;

	for(int i=0;i<N;i++) if(col[i]==0) sum2++;

	if(sum1>sum2) cout<<"Fennec"<<endl;

	else cout<<"Snuke"<<endl;

	return 0;

}

// Optimized solution to the same problem (faster):
/* long long or int & the MAX_INT or MIN_INT */

/* the size of a[] & inline */

/* xx 396 */



#include<bits/stdc++.h>

using namespace std;



const int MAX_N=1e5+10;



int cnt[MAX_N],N;

vector <int> G[MAX_N];

int First;

vector <int> Main;



inline void dfs(int at,int p){

	cnt[at]=1; Main.push_back(at);

	if(at==N-1) First=Main[(Main.size()+1)/2];

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

		int to=G[at][i];

		if(to!=p){

			dfs(to,at);

			cnt[at]+=cnt[to];

		}

	}

	Main.resize(Main.size()-1);

}



signed main(){

	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	cin>>N;

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

		int a,b; cin>>a>>b; a--; b--;

		G[a].push_back(b); G[b].push_back(a);

	}

	dfs(0,-1);

	bool win=cnt[First]*2<N;

	if(win) cout<<"Fennec"<<endl;

	else cout<<"Snuke"<<endl;

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int color[100050],fath[100050],n,ans[2];

vector <int> V[100050];

void build(int now,int f)

{

	fath[now]=f;

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

		if(V[now][i]!=f)build(V[now][i],now);

	return;

}

void dfs(bool flag,int now)

{

	color[now]=flag;

	ans[flag]++;

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

		if(color[V[now][i]]==-1)dfs(flag,V[now][i]);

}

int main()

{

	cin>>n;

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

	{

		int x,y;

		cin>>x>>y;

		V[x].push_back(y);

		V[y].push_back(x);

	}

	build(1,1);

	for(int i=1;i<=n;i++)color[i]=-1;

	int z=n,sum=0;

	while(z!=fath[z])

	{

		sum++;

		z=fath[z];

	}

	z=n;

	for(int i=1;i<=(sum-1)/2;i++)z=fath[z];

	color[z]=1;

	color[fath[z]]=0;

	dfs(1,z);

	dfs(0,fath[z]);

	if(ans[0]>ans[1])cout<<"Fennec";

	else cout<<"Snuke";

	return 0;

}

// Optimized solution to the same problem (faster):
#define _USE_MATH_DEFINES

#include <algorithm>

#include <array>

#include <bitset>

#include <cassert>

#include <cctype>

#include <climits>

#include <clocale>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <iterator>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <regex>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <tuple>

#include <unordered_map>

#include <unordered_set>

#include <utility>

#include <vector>



const int MOD = 1000000007; 

const int INF = 1000000000; //1e9

const int NIL = -1;

const long long LINF = 1000000000000000000; // 1e18

const long double EPS = 1E-10;



template<class T, class S> inline bool chmax(T &a, const S &b){

    if(a < b){

        a = b; return true;

    }

    return false;

}

template<class T, class S> inline bool chmin(T &a, const S &b){

    if(b < a){

        a = b; return true;

    }

    return false;

}









int main(){

    int N; std::cin >> N;

    std::vector<std::vector<int>> G(N);

    std::vector<int> d0(N, -1), dN(N, -1);

    {

        int a, b;

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

            std::cin >> a >> b;

            --a; --b;

            G[a].push_back(b);

            G[b].push_back(a);

        }

    }

    d0[0] = 0;

    std::queue<int> que;

    que.push(0);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(d0[e] != -1) continue;

            d0[e] = d0[v] + 1;

            que.push(e);

        }

    }

    dN[N-1] = 0;

    que.push(N-1);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(dN[e] != -1) continue;

            dN[e] = dN[v] + 1;

            que.push(e);

        }

    }

    int cnt(0);

    for(int i(0); i < N; ++i){

        if(d0[i] <= dN[i]) ++cnt; 

    }

    std::cout << ((2*cnt > N) ? "Fennec": "Snuke") << std::endl;

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int n;

vector<int>g[100001];

int main(){

	cin>>n;

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

		int x,y;

		cin>>x>>y;

		g[x].push_back(y);

		g[y].push_back(x);

	}

	vector<int>col(n+1);

	queue<int>q;

	q.push(1);

	q.push(n);

	col[1]=1;

	col[n]=2;

	int f,s;

	f=s=1;

	while(!q.empty()){

		int x=q.front();

		q.pop();

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

			int y=g[x][i];

			if(col[y]==0){

				q.push(y);

				col[y]=col[x];

				if(col[y]==1)f++;

				else s++;

			}

		}

	}

	if(f>s)cout<<"Fennec";

	else cout<<"Snuke";

	return 0;

}


// Optimized solution to the same problem (faster):
#define _USE_MATH_DEFINES

#include <algorithm>

#include <array>

#include <bitset>

#include <cassert>

#include <cctype>

#include <climits>

#include <clocale>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <iterator>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <regex>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <tuple>

#include <unordered_map>

#include <unordered_set>

#include <utility>

#include <vector>



const int MOD = 1000000007; 

const int INF = 1000000000; //1e9

const int NIL = -1;

const long long LINF = 1000000000000000000; // 1e18

const long double EPS = 1E-10;



template<class T, class S> inline bool chmax(T &a, const S &b){

    if(a < b){

        a = b; return true;

    }

    return false;

}

template<class T, class S> inline bool chmin(T &a, const S &b){

    if(b < a){

        a = b; return true;

    }

    return false;

}









int main(){

    int N; std::cin >> N;

    std::vector<std::vector<int>> G(N);

    std::vector<int> d0(N, -1), dN(N, -1);

    {

        int a, b;

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

            std::cin >> a >> b;

            --a; --b;

            G[a].push_back(b);

            G[b].push_back(a);

        }

    }

    d0[0] = 0;

    std::queue<int> que;

    que.push(0);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(d0[e] != -1) continue;

            d0[e] = d0[v] + 1;

            que.push(e);

        }

    }

    dN[N-1] = 0;

    que.push(N-1);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(dN[e] != -1) continue;

            dN[e] = dN[v] + 1;

            que.push(e);

        }

    }

    int cnt(0);

    for(int i(0); i < N; ++i){

        if(d0[i] <= dN[i]) ++cnt; 

    }

    std::cout << ((2*cnt > N) ? "Fennec": "Snuke") << std::endl;

    return 0;

}


// Fastest known solution for this problem: