stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:


#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;

}

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

}
// Slower C++ solution:
#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;

}

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

}
// Slower C++ solution:
#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;

}

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

}
// Slower C++ solution:
#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;

} 

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

}
// Slower C++ solution:
#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;

}

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

}
// Slower C++ solution:
#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;

}

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

}
// Slower C++ solution:
//#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;

}

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

}
// Slower C++ solution:
#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;

} 

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

}
// Slower C++ solution:
#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;

} 

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

}
// Slower C++ solution:
#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;

} 

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

}
// Slower C++ solution:
#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;

}

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

}
// Slower C++ solution:
#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;

	}

}

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

}