stablegradients/pie-gem5-pairs huggingface dataset:
// 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: 1.1157626420508877x):
#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;

}
// 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: 1.1166160612083635x):
#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;

}
// 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: 1.112159118829061x):
#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;

}
// 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: 1.1158438596584128x):
//#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;

}
// 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.477007965677x):
#include<bits/stdc++.h>

using namespace std;



const int inf=2000000000;

const long long llinf=9000000000000000000;



void dfs(int u,vector<vector<long long> > &e,vector<long long> &p,vector<long long> &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;

	vector<vector<long long> > e(n,vector<long long>());

	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<long long> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<long long> 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=0,rs=0;

	int i=0,j=(int)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.4855983476965036x):
#include<bits/stdc++.h>

using namespace std;



const int inf=2000000000;

const long long llinf=9000000000000000000;



void dfs(int u,vector<vector<long long> > &e,vector<long long> &p,vector<long long> &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;

	vector<vector<long long> > e(n,vector<long long>());

	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<long long> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<long long> 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=0,rs=0;

	int i=0,j=(int)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.885382865744837x):
#include<bits/stdc++.h>

using namespace std;



const int inf=2000000000;

const long long llinf=9000000000000000000;



void dfs(int u,vector<vector<long long> > &e,vector<long long> &p,vector<long long> &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;

	vector<vector<long long> > e(n,vector<long long>());

	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<long long> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<long long> 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=0,rs=0;

	int i=0,j=(int)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.482266495858921x):
#include<bits/stdc++.h>

using namespace std;



const int inf=2000000000;

const long long llinf=9000000000000000000;



void dfs(int u,vector<vector<long long> > &e,vector<long long> &p,vector<long long> &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;

	vector<vector<long long> > e(n,vector<long long>());

	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<long long> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<long long> 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=0,rs=0;

	int i=0,j=(int)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.479605032315413x):
#include<bits/stdc++.h>

using namespace std;



const int inf=2000000000;

const long long llinf=9000000000000000000;



void dfs(int u,vector<vector<long long> > &e,vector<long long> &p,vector<long long> &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;

	vector<vector<long long> > e(n,vector<long long>());

	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<long long> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<long long> 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=0,rs=0;

	int i=0,j=(int)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.4935494390726847x):
#include<bits/stdc++.h>

using namespace std;



const int inf=2000000000;

const long long llinf=9000000000000000000;



void dfs(int u,vector<vector<long long> > &e,vector<long long> &p,vector<long long> &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;

	vector<vector<long long> > e(n,vector<long long>());

	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<long long> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<long long> 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=0,rs=0;

	int i=0,j=(int)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.482013036245275x):
#include<bits/stdc++.h>

using namespace std;



const int inf=2000000000;

const long long llinf=9000000000000000000;



void dfs(int u,vector<vector<long long> > &e,vector<long long> &p,vector<long long> &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;

	vector<vector<long long> > e(n,vector<long long>());

	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<long long> p(n,-1),sz(n,0);

	dfs(0,e,p,sz);

	vector<long long> 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=0,rs=0;

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

	while(i<=j){

		ls+=path[i++];

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

	}

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

	return 0;

}