stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

const int MAXN=100000+10;

vector<int>edge[MAXN];//用邻接表来实现树的存储

int n,cnt[3];//cnt用来记录颜色数量

int tree[MAXN];//tree数组储存每个节点的颜色，1是指black，2指white

void bfs()

{

    queue<int>q;

    q.push(1),q.push(n);//Fennec先，Snuke后，所以先后入队

    while(!q.empty())

    {

        int temp=q.front();

        q.pop();

        cnt[tree[temp]]++;//注意位置！！

        for(int i=0;i<edge[temp].size();++i)//枚举所有节点

        {

            int v=edge[temp][i];

            if(tree[v])continue;

            else tree[v]=tree[temp];//判断是否涂过色

            q.push(v);

        }

    }

}

int main()

{

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

    cin>>n;

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

    {

        int x,y;

        cin>>x>>y;

        edge[x].push_back(y);

        edge[y].push_back(x);//邻接表建树

    }

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

    bfs();

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

		cout<<"Snuke"<<endl;

	}//因为Fennec先手，所以如果最终结果相同，很明显是Snuke赢了

    else{

    	cout<<"Fennec"<<endl;

	}

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define vvi vector<vector<long long> > 

using namespace std;

void dfs(int u,vvi &e,vector<int> &p,vector<int> &sz){

	sz[u]=1;

	for(int j=0;j<e[u].size();j++){

		int v=e[u][j];

		if(p[u]!=v){

			p[v]=u;

			dfs(v,e,p,sz);

			sz[u]+=sz[v];

		}

	}

} 

int main(){

	int n;

	cin>>n;

	vvi e(n);

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

		int a,b;

		cin>>a>>b;

		--a;

		--b;

		e[a].push_back(b);

		e[b].push_back(a);

	}

	vector<int> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<int> path ;

	int c=n-1,psz=0;

	while(c>=0){

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

		psz=sz[c];

		c=p[c];

	}

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

	long long ls=0LL,rs=0LL;

	int i=0,j=path.size()-1;

	while(i<=j){

		ls+=path[i++];

		if(i<=j)rs+=path[j--];

	}

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

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):


#include<iostream>

#include<cstdio>

#include<cstdlib>

#include<string>

#include<cstring>

#include<cmath>

#include<ctime>

#include<algorithm>

#include<utility>

#include<stack>

#include<queue>

#include<vector>

#include<set>

#include<map>

#include<bitset>

#define EPS 1e-9

#define PI acos(-1.0)

#define INF 0x3f3f3f3f

#define LL long long

const int MOD = 1E9+7;

const int N = 100000+5;

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

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

using namespace std;

vector<int> G[N];

int vis[N];

int main() {

    int n;

    scanf("%d",&n);

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

        int x,y;

        scanf("%d%d",&x,&y);

        G[x].push_back(y);

        G[y].push_back(x);

    }

 

    queue<int> Q;

    Q.push(1);

    Q.push(n);

    vis[1]=1;

    vis[n]=2;

 

    int fennec=0,snuke=0;

    while(!Q.empty()){

        int x=Q.front();

        Q.pop();

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

            int y=G[x][i];

            if(vis[y]==0){

                Q.push(y);

                vis[y]=vis[x];

                if(vis[y]==1)

                    fennec++;

                else if(vis[y]==2)

                    snuke++;

            }

        }

    }

    if(fennec>snuke)

        printf("Fennec\n");

    else

        printf("Snuke\n");

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define vvi vector<vector<long long> > 

using namespace std;

void dfs(int u,vvi &e,vector<int> &p,vector<int> &sz){

	sz[u]=1;

	for(int j=0;j<e[u].size();j++){

		int v=e[u][j];

		if(p[u]!=v){

			p[v]=u;

			dfs(v,e,p,sz);

			sz[u]+=sz[v];

		}

	}

} 

int main(){

	int n;

	cin>>n;

	vvi e(n);

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

		int a,b;

		cin>>a>>b;

		--a;

		--b;

		e[a].push_back(b);

		e[b].push_back(a);

	}

	vector<int> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<int> path ;

	int c=n-1,psz=0;

	while(c>=0){

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

		psz=sz[c];

		c=p[c];

	}

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

	long long ls=0LL,rs=0LL;

	int i=0,j=path.size()-1;

	while(i<=j){

		ls+=path[i++];

		if(i<=j)rs+=path[j--];

	}

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

	return 0;

}

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

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

#define FORN(i,n) for(int i=1;i<=n;i++)

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

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

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

#define ll long long

#define sz(s) s.size()

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

#define pii pair<int,int>

#define vpii vector<pair<int,int> >

using namespace std;

int n;

vector<int> gr[100010];

int cnt[100010];

int frst;

vector<int> Root;

void dfs(int x,int y){

	cnt[x]=1;

	Root.push_back(x);

	if(x==n){

		frst=Root[(Root.size()+1)/2];

	}

	REP(i,gr[x].size()){

		if(gr[x][i]==y)continue;

		dfs(gr[x][i],x);

		cnt[x]+=cnt[gr[x][i]];

	}

	Root.erase(Root.begin()+Root.size()-1);

}

int main(){

	cin>>n;

	REP(i,n-1){

		int a,b;

		cin>>a>>b;

		gr[a].push_back(b);

		gr[b].push_back(a);

	}

	frst=-1;

	dfs(1,1);

	if(cnt[frst]*2<n){

		cout<<"Fennec"<<endl;

	}

	else{

		cout<<"Snuke"<<endl;

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define vvi vector<vector<long long> > 

using namespace std;

void dfs(int u,vvi &e,vector<int> &p,vector<int> &sz){

	sz[u]=1;

	for(int j=0;j<e[u].size();j++){

		int v=e[u][j];

		if(p[u]!=v){

			p[v]=u;

			dfs(v,e,p,sz);

			sz[u]+=sz[v];

		}

	}

} 

int main(){

	int n;

	cin>>n;

	vvi e(n);

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

		int a,b;

		cin>>a>>b;

		--a;

		--b;

		e[a].push_back(b);

		e[b].push_back(a);

	}

	vector<int> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<int> path ;

	int c=n-1,psz=0;

	while(c>=0){

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

		psz=sz[c];

		c=p[c];

	}

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

	long long ls=0LL,rs=0LL;

	int i=0,j=path.size()-1;

	while(i<=j){

		ls+=path[i++];

		if(i<=j)rs+=path[j--];

	}

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

	return 0;

}

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

using namespace std;

int n,dist1[100005],dist2[100005],resf,ress;

vector<int> son[100005];

void dfs1(int c,int f,int d)

{

	dist1[c]=d;

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

		if (son[c][i]!=f)

			dfs1(son[c][i],c,d+1);

}

void dfs2(int c,int f,int d)

{

	dist2[c]=d;

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

		if (son[c][i]!=f)

			dfs2(son[c][i],c,d+1);

}

int main()

{

	cin>>n;

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

	{

		int a,b;

		cin>>a>>b;

		son[a].push_back(b);

		son[b].push_back(a);	

	}

	dfs1(1,-1,0);

	dfs2(n,-1,0);

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

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

			resf++;

		else

			ress++;

	if (resf>ress)

		cout<<"Fennec";

	else

		cout<<"Snuke";

	return 0;

} 

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define vvi vector<vector<long long> > 

using namespace std;

void dfs(int u,vvi &e,vector<int> &p,vector<int> &sz){

	sz[u]=1;

	for(int j=0;j<e[u].size();j++){

		int v=e[u][j];

		if(p[u]!=v){

			p[v]=u;

			dfs(v,e,p,sz);

			sz[u]+=sz[v];

		}

	}

} 

int main(){

	int n;

	cin>>n;

	vvi e(n);

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

		int a,b;

		cin>>a>>b;

		--a;

		--b;

		e[a].push_back(b);

		e[b].push_back(a);

	}

	vector<int> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<int> path ;

	int c=n-1,psz=0;

	while(c>=0){

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

		psz=sz[c];

		c=p[c];

	}

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

	long long ls=0LL,rs=0LL;

	int i=0,j=path.size()-1;

	while(i<=j){

		ls+=path[i++];

		if(i<=j)rs+=path[j--];

	}

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

	return 0;

}

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

using namespace std;

int n,frst,cnt[100005];

vector<int> son[100005];

vector<int> st;

void dfs(int v,int p)

{

	cnt[v]=1;

	st.push_back(v);

	if (v==n-1)

		frst=st[(st.size()+1)/2];

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

	{

		int to=son[v][i];

		if (to==p)

			continue;

		dfs(to,v);

		cnt[v]+=cnt[to];

	}

	st.pop_back();

}

int main()

{

	cin>>n;

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

	{

		int a,b;

		cin>>a>>b;

		a--;b--;

		son[a].push_back(b);

		son[b].push_back(a); 

	}

	dfs(0,0);

	bool win=(cnt[frst]*2<n);

	string ans=(win?"Fennec":"Snuke");

	cout<<ans;

	return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define vvi vector<vector<long long> > 

using namespace std;

void dfs(int u,vvi &e,vector<int> &p,vector<int> &sz){

	sz[u]=1;

	for(int j=0;j<e[u].size();j++){

		int v=e[u][j];

		if(p[u]!=v){

			p[v]=u;

			dfs(v,e,p,sz);

			sz[u]+=sz[v];

		}

	}

} 

int main(){

	int n;

	cin>>n;

	vvi e(n);

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

		int a,b;

		cin>>a>>b;

		--a;

		--b;

		e[a].push_back(b);

		e[b].push_back(a);

	}

	vector<int> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<int> path ;

	int c=n-1,psz=0;

	while(c>=0){

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

		psz=sz[c];

		c=p[c];

	}

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

	long long ls=0LL,rs=0LL;

	int i=0,j=path.size()-1;

	while(i<=j){

		ls+=path[i++];

		if(i<=j)rs+=path[j--];

	}

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

	return 0;

}

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

using namespace std;

typedef long long ll;

const int maxx=1e5+100;

const int INF=1e9;

const int MOD=1e9+7;

vector<int> mapp[maxx];

int vis[maxx];

int n;

int ans[5];

void dfs(int x,int y)

{

    vis[x]=1;

    vis[y]=2;

    queue<int> q;

    q.push(x);

    q.push(y);

    while(!q.empty()){

        int p=q.front();

        ans[vis[p]]++;

        q.pop();

        for(int i=0; i<mapp[p].size(); i++){

            if(vis[mapp[p][i]])   continue;

            vis[mapp[p][i]]=vis[p];

            q.push(mapp[p][i]);

        }

    }

}

int main()

{

    cin>>n;

    int a,b;

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

        cin>>a>>b;

        mapp[a].push_back(b);

        mapp[b].push_back(a);

    }

    dfs(1,n);

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

    else               cout<<"Snuke"<<endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define vvi vector<vector<long long> > 

using namespace std;

void dfs(int u,vvi &e,vector<int> &p,vector<int> &sz){

	sz[u]=1;

	for(int j=0;j<e[u].size();j++){

		int v=e[u][j];

		if(p[u]!=v){

			p[v]=u;

			dfs(v,e,p,sz);

			sz[u]+=sz[v];

		}

	}

} 

int main(){

	int n;

	cin>>n;

	vvi e(n);

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

		int a,b;

		cin>>a>>b;

		--a;

		--b;

		e[a].push_back(b);

		e[b].push_back(a);

	}

	vector<int> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<int> path ;

	int c=n-1,psz=0;

	while(c>=0){

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

		psz=sz[c];

		c=p[c];

	}

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

	long long ls=0LL,rs=0LL;

	int i=0,j=path.size()-1;

	while(i<=j){

		ls+=path[i++];

		if(i<=j)rs+=path[j--];

	}

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

	return 0;

}

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

//using namespace std;

//int dis[100005];

//int n;

//vector<int>vec[100005];

//void dfs(int i)

//{

//	dis[i]=1;

//	for(int j=0;j<vec[i].size();j++)

//		if(dis[vec[i][j]]==0)

//		{

//			dfs(vec[i][j]);

//			dis[i]+=dis[vec[i][j]];

//		}

//}

//vector<int>ans;

//bool vis[100005],ok;

//void dfs2(int x)

//{

//	vis[x]=1;

//	if(!ok)ans.push_back(x);

//	if(x==n)

//	{

//		ok=1;

//		return;

//	}

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

//		if(!vis[vec[x][i]])

//			dfs2(vec[x][i]);

//	if(!ok)ans.pop_back();

//}

//int main()

//{

//	cin>>n;

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

//	{

//		int x,y;

//		cin>>x>>y;

//		vec[x].push_back(y);

//		vec[y].push_back(x);

//	}

//	dfs(1);

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

////		cout<<dis[i]<<' ';

////	cout<<endl;

//	dfs2(1);

//	int x=ans[(ans.size()+1)/2];

////	for(int i=0;i<ans.size();i++)

////		cout<<ans[i]<<' ';

////	cout<<endl;

//	x=dis[x];

//	if(x>=n-x)cout<<"Snuke";

//	else cout<<"Fennec";

//	return 0;

//}



#include<bits/stdc++.h>

using namespace std;

int n,p[100005],sz[100005];

vector<int>vec[100005];

void dfs(int x)

{

	sz[x]=1;

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

	{

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

		{

			p[vec[x][i]]=x;

			dfs(vec[x][i]);

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

		}

	}

}

int main()

{

	cin>>n;

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

	{

		int x,y;

		cin>>x>>y;

		vec[x].push_back(y);

		vec[y].push_back(x);

	}

	dfs(1);

	vector<int>path;

	int c=n,psz=0;

	while(c>0)

	{

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

		psz=sz[c];

		c=p[c];

	}

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

	int l=0,r=0;

	int i=0,j=path.size()-1;

	while(i<=j)

	{

		l+=path[i++];

		if(i<=j)r+=path[j--];

	}

	if(l>r)cout<<"Fennec";

	else cout<<"Snuke";

	return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define vvi vector<vector<long long> > 

using namespace std;

void dfs(int u,vvi &e,vector<int> &p,vector<int> &sz){

	sz[u]=1;

	for(int j=0;j<e[u].size();j++){

		int v=e[u][j];

		if(p[u]!=v){

			p[v]=u;

			dfs(v,e,p,sz);

			sz[u]+=sz[v];

		}

	}

} 

int main(){

	int n;

	cin>>n;

	vvi e(n);

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

		int a,b;

		cin>>a>>b;

		--a;

		--b;

		e[a].push_back(b);

		e[b].push_back(a);

	}

	vector<int> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<int> path ;

	int c=n-1,psz=0;

	while(c>=0){

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

		psz=sz[c];

		c=p[c];

	}

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

	long long ls=0LL,rs=0LL;

	int i=0,j=path.size()-1;

	while(i<=j){

		ls+=path[i++];

		if(i<=j)rs+=path[j--];

	}

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

	return 0;

}

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

using namespace std;

vector <int> v[100010];

int d1[100010],d2[100010];

int main()

{

	int n,sum1=0,sum2=0;

	cin>>n;

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

	{

		int a,b;

		cin>>a>>b;

		v[a].push_back(b);

		v[b].push_back(a);

	}	

	memset(d1,63,sizeof(d1));

	memset(d2,63,sizeof(d2));

	queue <int> q1;

	queue <int> q2;	

	q1.push(1);

	d1[1]=0;

	while(!q1.empty())

	{

		int u=q1.front();

		q1.pop();

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

		{

			if(d1[v[u][i]]>1e8)

			{

				d1[v[u][i]]=d1[u]+1;

				q1.push(v[u][i]);

			}

		}

	}

	q2.push(n);

	d2[n]=0;

	while(!q2.empty())

	{

		int u=q2.front();

		q2.pop();

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

		{

			if(d2[v[u][i]]>1e8)

			{

				d2[v[u][i]]=d2[u]+1;

				q2.push(v[u][i]);

			} 

		}

	}

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

	{

		if(d1[i]<d2[i])

			sum1++;

		if(d1[i]>d2[i])

			sum2++;

		if(d1[i]==d2[i])

			sum1++;

	}

	if(sum1>sum2)

		cout<<"Fennec"<<endl;

	else

		cout<<"Snuke"<<endl;

	return 0;

} 

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



const int maxn = 1e5 + 10;

int n, l, r, q[maxn], vis[maxn];



vector <int> e[maxn];



int main() {

	scanf("%d", &n);

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

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

		e[u].push_back(v), e[v].push_back(u);

	}

	l = 1, r = 0;

	vis[1] = 1;

	vis[n] = 2;

	q[++r] = 1;

	q[++r] = n;

	for (; l <= r; ) {

		int u = q[l++];

		for (int v : e[u]) {

			if (!vis[v]) {

				vis[v] = vis[u];

				q[++r] = v;

			}

		}

	}

	int sum1 = 0, sum2 = 0;

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

		if (vis[i] == 1) {

			sum1++;

		} else {

			sum2++;

		}

	}

	puts(sum1 > sum2 ? "Fennec" : "Snuke");

	return 0;

}

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

using namespace std;

const int MAXN=100000+10;

vector<int>edge[MAXN];

int n,cnt[3];

int tree[MAXN];

void bfs()

{

    queue<int>q;

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

    while(!q.empty())

    {

        int temp=q.front();

        q.pop();

        cnt[tree[temp]]++;

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

        {

            int v=edge[temp][i];

            if(tree[v])continue;

            else tree[v]=tree[temp];

            q.push(v);

        }

    }

}

int main()

{

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

    cin>>n;

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

    {

        int x,y;

        cin>>x>>y;

        edge[x].push_back(y);

        edge[y].push_back(x);

    }

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

    bfs();

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

		cout<<"Snuke"<<endl;

	}

    else{

    	cout<<"Fennec"<<endl;

	}

    return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



const int maxn = 1e5 + 10;

int n, l, r, q[maxn], vis[maxn];



vector <int> e[maxn];



int main() 

{

    cin>>n;

    for (int i = 1, u, v; i < n; i++) 

    {

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

        e[u].push_back(v), e[v].push_back(u);

    }

    l = 1, r = 0;

    vis[1] = 1;

    vis[n] = 2;

    q[++r] = 1;

    q[++r] = n;

    for (; l <= r; ) 

    {

        int u = q[l++];

        for (int v : e[u]) 

        {

            if (!vis[v]) 

            {

                vis[v] = vis[u];

                q[++r] = v;

            }

        }

    }

    int sum1 = 0, sum2 = 0;

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

    {

        if (vis[i] == 1) 

        {

            sum1++;

        } 

        else 

        {

            sum2++;

        }

    }

    puts(sum1 > sum2 ? "Fennec" : "Snuke");

    return 0;

}

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

using namespace std;

typedef long long ll;



const int MAXN=1<<18;



int n;

vector<int> e[MAXN];

int cnt[MAXN];

vector<int> vct;

int frst;



void dfs(int v, int pr){

	cnt[v] = 1;

	vct.push_back(v);

	

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

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

		if(e[v][i]==pr) continue;

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

		cnt[v] += cnt[e[v][i]];

	}

	vct.pop_back();

}



int main(){

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

		for(int i=0; i<n; i++) e[i].clear();

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

			int u, v;

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

			--u;--v;

			e[u].push_back(v);

			e[v].push_back(u);

		}

		frst = -1;

		dfs(0, 0);

		bool win=cnt[frst]*2<n;

		string ans=win?"Fennec":"Snuke";

		cout << ans;

		return 0;

	}

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



const int maxn = 1e5 + 10;

int n, l, r, q[maxn], vis[maxn];



vector <int> e[maxn];



int main() 

{

    cin>>n;

    for (int i = 1, u, v; i < n; i++) 

    {

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

        e[u].push_back(v), e[v].push_back(u);

    }

    l = 1, r = 0;

    vis[1] = 1;

    vis[n] = 2;

    q[++r] = 1;

    q[++r] = n;

    for (; l <= r; ) 

    {

        int u = q[l++];

        for (int v : e[u]) 

        {

            if (!vis[v]) 

            {

                vis[v] = vis[u];

                q[++r] = v;

            }

        }

    }

    int sum1 = 0, sum2 = 0;

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

    {

        if (vis[i] == 1) 

        {

            sum1++;

        } 

        else 

        {

            sum2++;

        }

    }

    puts(sum1 > sum2 ? "Fennec" : "Snuke");

    return 0;

}

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

}


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

}

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

	}

}

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

}

// Fastest known solution for this problem: