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

#include <vector>

#include <stack>

using namespace std;



int n;

vector<int> pos[100010];

stack<int> sta;

int cnt[100010],first;



inline void dfs(int v,int pr)

{

	cnt[v]=1;

	sta.push(v);

	

	if(v==n-1)

	{

		stack<int> t=sta;

		for(int i=0;i<sta.size()/2-1;i++) t.pop();

		first=t.top();

	}

	

	for(auto to:pos[v])

	{

		if(to==pr) continue;

		dfs(to,v);

		cnt[v]+=cnt[to];

	}

	sta.pop();

}



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<cstdio>

#include<vector>

#include<algorithm>

using namespace std;

typedef unsigned uint;

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

int n;

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

	sz[u]=1;

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

		int to=E[u][i];

		if(p[u]!=to){

			p[to]=u;

			dfs(to,E,p,sz);

			sz[u]+=sz[to];

		}

	}

}

int main(){

    n=in();

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

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

		int a,b;

		a=in();b=in();

		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());

	int ls=0;

	for(int i=0;i<((int)path.size()+1)/2;i++){

		ls+=path[i];

	}

	if(2*ls>n)printf("Fennec");

	else printf("Snuke");

	return 0;

}

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

using namespace std;



vector<int>adjList[100005];



int nodeWeight[100005];

int distances[100005];

int backNode[100005];

int n,a,b,pathLength=0;

int dfs(int node,int dist, int bk){

    distances[node]=dist;

    if(node==n-1)pathLength=dist+1;//including root

    backNode[node]=bk;

    if(adjList[node].size()==1 && node!=0){

        return nodeWeight[node]=1;

    }

    int ans=1;

    for(int i=0;i<adjList[node].size();i++){

        if(adjList[node][i]!=bk){

            ans+=dfs(adjList[node][i],dist+1,node);

        }

    }

    return nodeWeight[node]=ans;

}



int main(){

    cin>>n;

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

        cin>>a>>b;

        adjList[a-1].push_back(b-1);

        adjList[b-1].push_back(a-1);

    }



    dfs(0,0,-1);



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

//        cout<<i<<" <- "<<nodeWeight[i]<<" - "<<distances[i]<<" - "<<backNode[i]<<endl;

//    }



    int l=n-1;

    int fennec=0, snuke=0;

    int m=pathLength/2;

    int b=l;

    while(m--){

        snuke+=(nodeWeight[b]-snuke);

        b=backNode[l];

        l=b;

    }

    fennec=n-snuke;



    if(fennec>snuke)cout<<"Fennec\n";

    else cout<<"Snuke\n";

//    cout<<fennec<<" - "<<snuke<<endl;



}


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

#include<vector>

#include<algorithm>

using namespace std;

typedef unsigned uint;

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

int n;

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

	sz[u]=1;

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

		int to=E[u][i];

		if(p[u]!=to){

			p[to]=u;

			dfs(to,E,p,sz);

			sz[u]+=sz[to];

		}

	}

}

int main(){

    n=in();

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

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

		int a,b;

		a=in();b=in();

		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());

	int ls=0;

	for(int i=0;i<((int)path.size()+1)/2;i++){

		ls+=path[i];

	}

	if(2*ls>n)printf("Fennec");

	else printf("Snuke");

	return 0;

}

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

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

 

using namespace std;

using namespace __gnu_pbds;

 

#define fi first

#define se second

#define mp make_pair

#define pb push_back

#define fbo find_by_order

#define ook order_of_key

 

typedef long long ll;

typedef pair<int,int> ii;

typedef vector<int> vi;

typedef long double ld; 

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

typedef set<int>::iterator sit;

typedef map<int,int>::iterator mit;

typedef vector<int>::iterator vit;



vi adj[111111];

int sub[111111];

int par[111111];

int h[111111];



void dfs(int u, int p)

{

	sub[u]=1;

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

	{

		int v=adj[u][i];

		if(v==p) continue;

		par[v]=u;

		h[v]=h[u]+1;

		dfs(v,u);

		sub[u]+=sub[v];

	}

}



int main()

{

	ios_base::sync_with_stdio(0); cin.tie(0);

	int n; cin>>n;

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

	{

		int u,v; cin>>u>>v;

		u--; v--;

		adj[u].pb(v); adj[v].pb(u);

	}

	par[0]=-1;

	dfs(0,-1);

	int cur=n-1;

	for(int i=0;i<(h[n-1]-1)/2;i++)

	{

		cur=par[cur];

	}

	if(n-sub[cur]>=n/2+1) cout<<"Fennec\n";

	else cout<<"Snuke\n";

}


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

#include<vector>

#include<algorithm>

using namespace std;

typedef unsigned uint;

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

int n;

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

	sz[u]=1;

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

		int to=E[u][i];

		if(p[u]!=to){

			p[to]=u;

			dfs(to,E,p,sz);

			sz[u]+=sz[to];

		}

	}

}

int main(){

    n=in();

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

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

		int a,b;

		a=in();b=in();

		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());

	int ls=0;

	for(int i=0;i<((int)path.size()+1)/2;i++){

		ls+=path[i];

	}

	if(2*ls>n)printf("Fennec");

	else printf("Snuke");

	return 0;

}

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

////////// ^\/^ *_* :) :-D '~' \\\\\\\\\\

/////////////////////////////////////////

#include <bits/stdc++.h>

//#include <algorithm>

//#include <cstdio>

//#include <functional>

#include <iostream>

//#include <cfloat>

//#include <climits>

//#include <cstdlib>

//#include <cstring>

//#include <cmath>

//#include <map>

//#include <queue>

//#include <set>

//#include <sstream>

//#include <stack>

//#include <string>

//#include <time.h>

//#include <vector>

//#include <random>

//#include <unordered_set>

//#include <complex>

//#include <string.h>



#define rt0 return 0

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

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

#define LL long long

#define pii pair<int,int>

#define pb push_back

#define fi first

#define se second

#define mpr make_pair



using namespace std;



const LL MOD=1e9+7;

int n,dist[100010],dist2[100010];

vector <int> g[100010];



int main()

{

	cin>>n;

	rep(i,n-1)

	{

		int x,y;

		cin>>x>>y;

		g[x].pb(y);

		g[y].pb(x);

	}

	memset(dist,1,sizeof(dist));

	memset(dist2,1,sizeof(dist2));

	queue <int> q;

	dist[1]=0;

	q.push(1);

	while(!q.empty())

	{

		int t=q.front();

		q.pop();

		rep(i,g[t].size())

		{

			if(dist[g[t][i]]!=16843009) continue;

			else

			{

				dist[g[t][i]]=dist[t]+1;

				q.push(g[t][i]);

			}

		}

	}

	queue <int> q1;

	dist2[n]=0;

	q1.push(n);

	while(!q1.empty())

	{

		int t=q1.front();

		q1.pop();

		rep(i,g[t].size())

		{

			if(dist2[g[t][i]]!=16843009) continue;

			else

			{

				dist2[g[t][i]]=dist2[t]+1;

				q1.push(g[t][i]);

			}

		}

	}

	int fen=0,snu=0;

	repn(i,n)

	{

		if(dist[i]<=dist2[i]) fen++;

		else snu++;

	}

	if(fen>snu) puts("Fennec");

	else puts("Snuke");

	rt0;

}

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

#include<vector>

#include<algorithm>

using namespace std;

typedef unsigned uint;

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

int n;

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

	sz[u]=1;

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

		int to=E[u][i];

		if(p[u]!=to){

			p[to]=u;

			dfs(to,E,p,sz);

			sz[u]+=sz[to];

		}

	}

}

int main(){

    n=in();

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

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

		int a,b;

		a=in();b=in();

		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());

	int ls=0;

	for(int i=0;i<((int)path.size()+1)/2;i++){

		ls+=path[i];

	}

	if(2*ls>n)printf("Fennec");

	else printf("Snuke");

	return 0;

}

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

int n;

vector<int>G[100005];

int dist1[100005],dist2[100005];

void dfs1(int v,int p,int t){

	dist1[v]=t;

	rep(i,SZ(G[v])){

		int to=G[v][i];

		if(to!=p){

			dfs1(to,v,t+1);

		}

	}

}

void dfs2(int v,int p,int t){

	dist2[v]=t;

	rep(i,SZ(G[v])){

		int to=G[v][i];

		if(to!=p){

			dfs2(to,v,t+1);

		}

	}

}

int main(){

    cin.sync_with_stdio(false);cin.tie(0);

	cin>>n;

	rep(i,n-1){

		int u,v;

		cin>>u>>v;

		G[u].push_back(v);

		G[v].push_back(u);

	}

	dfs1(1,-1,0);

	dfs2(n,-1,0);

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

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

//	}

//	cout<<endl;

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

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

//	}

//	cout<<endl;

	int cnt1=0,cnt2=0;

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

		if(dist1[i]<=dist2[i])cnt1++;

		else cnt2++;

	}

	if(cnt1>cnt2)cout<<"Fennec"<<endl;

	else cout<<"Snuke"<<endl;

	return 0;

}

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

#include<vector>

#include<algorithm>

using namespace std;

typedef unsigned uint;

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

int n;

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

	sz[u]=1;

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

		int to=E[u][i];

		if(p[u]!=to){

			p[to]=u;

			dfs(to,E,p,sz);

			sz[u]+=sz[to];

		}

	}

}

int main(){

    n=in();

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

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

		int a,b;

		a=in();b=in();

		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());

	int ls=0;

	for(int i=0;i<((int)path.size()+1)/2;i++){

		ls+=path[i];

	}

	if(2*ls>n)printf("Fennec");

	else printf("Snuke");

	return 0;

}

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

using namespace std;

int dist1[200009],dist2[200009],n,a,b;

vector<int>x[200009];

void dfs1(int pos,int depth)

{

    

    if(dist1[pos]!=-1) return;

    dist1[pos]=depth;

    for(int i=0; i<x[pos].size(); i++) dfs1(x[pos][i],depth+1);

}

void dfs2(int pos,int depth)

{

    

    if(dist2[pos]!=-1) return;

    dist2[pos]=depth;

    for(int i=0; i<x[pos].size(); i++) dfs2(x[pos][i],depth+1);

}

int main()

{

    cin>>n;

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

    {

        cin>>a>>b;

        x[a].push_back(b);

        x[b].push_back(a);

    }

    for(int i=0; i<200009; i++)

    {

        dist1[i]=-1;

        dist2[i]=-1;

    }

    dfs1(1,0);

    dfs2(n,0);

    int cnt1=0,cnt2=0;

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

    {

        if(dist1[i]<=dist2[i]) cnt1++;

        else cnt2++;

    }

    if(cnt1>cnt2) 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=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];

            //cnt[tree[temp]]++;  不要在意细节（^_^）

            if(tree[v])continue;

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

            q.push(v);

        }

    }

}



int main()

{

    ios::sync_with_stdio(false);

    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])//因为Fennec先手，所以如果最终结果相同，很明显是Snuke赢了

        cout<<"Snuke"<<endl;

    else

        cout<<"Fennec"<<endl;

    return 0;

}

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

#include <queue>

#include <vector>

#define SHN 1000000ll

using namespace std;

int n;

vector<int> d1(100010,SHN),d2(100010,SHN);

vector<int> edge[100010];

void bfs(vector<int> &d,int s)

{

	queue<int> q;

	q.push(s);

	d[s]=0;

	while (!q.empty())

	{

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

		int t=d[x];

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

		{

			int xi=edge[x][i];

			if (d[xi]>t+1) d[xi]=t+1,q.push(xi);

		}

	}

}

int main()

{

	cin >>n;

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

	{

		int x,y;

		cin >>x>>y;

		x--,y--;

		edge[x].push_back(y);

		edge[y].push_back(x);

	}

	bfs(d1,0);

	bfs(d2,n-1);

	int r1=0,r2=0;

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

	{

		//cout <<d1[i]<<" "<<d2[i]<<"\n";

		if (d1[i]<=d2[i]) r1++;

		else r2++;

	}

	cout <<(r1>r2 ? "Fennec" : "Snuke");

	return 0;

}

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

#include <queue>

#include <vector>

using namespace std;

int n;

vector<int> edge[100010];

queue<int> q;

int col[100010];

int main()

{

	cin >>n;

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

	{

		int x,y;

		cin >>x>>y;

		x--,y--;

		edge[x].push_back(y);

		edge[y].push_back(x);

	}

	fill(col,col+n,-1);

	col[0]=1;

	col[n-1]=0;

	q.push(0);

	q.push(n-1);

	while (!q.empty())

	{

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

		int t=col[x];

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

		{

			int xi=edge[x][i];

			if (col[xi]==-1) col[xi]=t,q.push(xi);

		}

	}

	int r1=0,r2=0;

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

	{

		if (col[i]) r1++;

		else r2++;

	}

	cout <<(r1>r2 ? "Fennec" : "Snuke");

	return 0;

}

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

using namespace std;



const int maxn = 200000+16;



int n;

vector<int> g[maxn];

int d1[maxn], d2[maxn];



void dfs(int p, int last, int d, int wd[]) {

   wd[p] = d;

   for (int x : g[p]) {

      if (x != last) {

         dfs(x, p, d+1, wd);

      }

   }

}



int main() {

   cin >> n;

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

      g[i].clear();

   }

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

      int x, y;

      cin >> x >> y;

      --x, --y;

      g[x].push_back(y);

      g[y].push_back(x);

   }

   dfs(0, -1, 0, d1);

   dfs(n-1, -1, 0, d2);



   int ret = 0;

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

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

         ++ret;

      } else {

         --ret;

      }

   }



   puts(ret>0?"Fennec":"Snuke");



   return 0;

}

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

using namespace std;



#define ll long long

#define vvi vector<vector<int>>

#define vec vector

#define pq priority_queue

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

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

#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))

#define debug(x) cerr << #x << ": " << x << endl;

#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;

#define debug3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;

#define debugB(x, y) cerr<<#x<<": "<<bitset<y>(x) << endl;

#define line() cerr << "---------------" << endl;



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

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



template<typename T>

   void printA(vector<T> &printArray, char between = ' ') {

   int paSize = printArray.size();

   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}

   if (between != '\n') {cerr << endl;}

}



// ------------------------------------------------------------------------------------------



int N;

vec<vec<int>> G;



void dfs(int pos, vec<int> &dist) {

   if (dist[pos] == -1) return;

   for (int to : G[pos]) {

      if (dist[to] == -1) {

         dist[to] = dist[pos] + 1;

         dfs(to, dist);

      }

   }

}



int main() {

   cin >> N;

   G = vec<vec<int>>(N);

   rep (i, N-1) {

      int a, b;

      cin >> a >> b;

      a--, b--;

      G[a].push_back(b);

      G[b].push_back(a);

   }

   vec<int> dist1(N, -1), dist2(N, -1);

   dist1[0] = 0;

   dfs(0, dist1);

   dist2[N-1] = 0;

   dfs(N-1, dist2);



   int b = 0, w = 0;

   rep (i, N) {

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

         b++;

      } else {

         w++;

      }

   }



   if (b > w) {

      puts("Fennec");

   } else {

      puts("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];

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<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<stdio.h>

#include<string>

#include<math.h>

#include<stdlib.h>

#include<set>

#include<bitset>

#include<map>

#include<vector>

#include<string.h>

#include<algorithm>

#include<iostream>

#include<queue>

#include<deque>

#include<stack>

using namespace std;



const int INF=12345678;

int n,par,dist[100005];

vector<int> nei[100005],v;

queue<int> q;



void DFS(int x,int pr){

	dist[x]=1;

	v.push_back(x);

	if(x==n-1){

		par=v[(v.size()+1)/2];

		//return;

	}

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

		int now=nei[x][i];

		if(pr==now) continue;

		DFS(now,x);

		dist[x]+=dist[now];

	}

	v.pop_back();

}



int main(){

	cin>>n;

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

		int x,y;

		cin>>x>>y;

		x--;

		y--;

		nei[x].push_back(y);

		nei[y].push_back(x);

	}

	par=-1;

	DFS(0,0);

	if(dist[par]*2<n) puts("Fennec");

	else puts("Snuke");

	return 0;

}

// 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<iostream>

#include<cstdio>

#include<algorithm>

#include<queue>

#include<string>

#include<string.h>

#include<memory.h>

#include<vector>

#include<map>

#include<set>

#include<utility>

#include<sstream>

#include<cmath>

#include<list>

#include<deque>

#include<stack>

#include<ctime>

using namespace std;         //一遍dfs，利用nreach,son计算点的个数

vector<int> q;

vector<int> r[100100];

int son[100100];

int nreach,n;

int dfs(int a,int fa)

{q.push_back(a);

son[a]=1;

if(a==n) {nreach=q[(q.size()+1)/2];}

for(int i=0;i<r[a].size();i++)

								{int nex=r[a][i];

								if(nex==fa) continue;

								son[a]+=dfs(nex,a);

								}

q.pop_back();

return son[a];

}

int main()

{cin>>n;

int a,b;

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

{cin>>a>>b;

r[a].push_back(b);

r[b].push_back(a);

}

int _=dfs(1,-1);

if(son[nreach]<son[1]-son[nreach])  cout<<"Fennec";

else cout<<"Snuke";

return 0;

}


// 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: