stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <iostream>

#include <vector>

#include <queue>

using namespace std;



struct edge{

    int to;

    int cost;

    edge(int a, int b){

        to=a;

        cost=b;

    }

};

typedef pair<long long, int> P;

struct D{

    vector<edge> G[100008];

    long long d[100008],INF=1e18;

    void AddEdge(int from, int to, int cost){

        G[from].push_back(edge(to, cost));

    }

    void dijkstra(int n, int s){

        priority_queue<P, vector<P>, greater<P>> q;

        fill(d,d+n,INF);

        d[s]=0;

        q.push(P(0,s));

        while(!q.empty()){

            P p=q.top();

            q.pop();

            int v=p.second;

            if(d[v]<p.first)continue;

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

                edge e=G[v][i];

                if(d[e.to]>d[v]+e.cost){

                    d[e.to]=d[v]+e.cost;

                    q.push(P(d[e.to],e.to));

                }

            }

        }

    }

};



int main(void){

    int n,f=0;

    D d,e;

    cin>>n;

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

        int a,b;

        cin>>a>>b;

        a--;

        b--;

        d.AddEdge(a,b,1);

        d.AddEdge(b,a,1);

        e.AddEdge(a,b,1);

        e.AddEdge(b,a,1);

    }

    d.dijkstra(n,0);

    e.dijkstra(n,n-1);

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

        if(d.d[i]<=e.d[i]){

            f++;

        }

    }

    if(f>n-2-f){

        cout<<"Fennec"<<endl;

    }else{

        cout<<"Snuke"<<endl;

    }

}




// Faster C++ solution for the same problem (measured speedup: 1.8647449286928501x):
#include <iostream>

#include <vector>

using namespace std;

int d[100000][2];

vector<int> v[100000];

void f(int x, int y, int z){

    d[x][y] = z;

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

        if(d[v[x][i]][y] == -1){

            f(v[x][i], y, z+1);

        }

    }

}

int main(void){

    int n, c=0;

    cin >> n;

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

        int a, b;

        cin >> a >> b;

        a--;

        b--;

        v[a].push_back(b);

        v[b].push_back(a);

    }

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

        d[i][0] = d[i][1] = -1;

    }

    f(0, 0, 0);

    f(n-1, 1, 0);

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

        if(d[i][0] <= d[i][1]){

            c++;

        }

    }

    

    if(c*2 > n){

        cout << "Fennec" << endl;

    }else{

        cout << "Snuke" << endl;

    }

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

}

// Faster C++ solution for the same problem (measured speedup: 3.5934478648046477x):
#include<iostream>

#include<cstdio>

using namespace std;

int siz[101000],fa[101000];

int h[101000],nxt[201000],K=0,to[201000];

void ins(int u,int v){nxt[++K]=h[u];h[u]=K;to[K]=v;}

void dfs(int x,int f)

{

	fa[x]=f;siz[x]=1;

	for(int i=h[x];i;i=nxt[i])

	{

		if(to[i]==f)continue;

		dfs(to[i],x);siz[x]+=siz[to[i]];

	}

}

int main()

{

	int n;scanf("%d",&n);

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

	{

		int a,b;scanf("%d%d",&a,&b);

		ins(a,b);ins(b,a);

	}

	dfs(1,0);int tot=0;

	for(int i=fa[n];i!=1;i=fa[i])tot++;

	int k=n;

	for(int i=1;i<=tot/2;i++)k=fa[k];

	int ls1=n-siz[k]-(tot-tot/2),ls2=siz[k]-tot/2;

	if(tot&1)

	{

		if(ls2<=ls1)puts("Fennec");

		else puts("Snuke");

	}

	else

	{

		if(ls1<=ls2)puts("Snuke");

		else puts("Fennec");

	}

	return 0;

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



}


// Faster C++ solution for the same problem (measured speedup: 3.5856216372367813x):
#include<iostream>

#include<cstdio>

using namespace std;

int siz[101000],fa[101000];

int h[101000],nxt[201000],K=0,to[201000];

void ins(int u,int v){nxt[++K]=h[u];h[u]=K;to[K]=v;}

void dfs(int x,int f)

{

	fa[x]=f;siz[x]=1;

	for(int i=h[x];i;i=nxt[i])

	{

		if(to[i]==f)continue;

		dfs(to[i],x);siz[x]+=siz[to[i]];

	}

}

int main()

{

	int n;scanf("%d",&n);

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

	{

		int a,b;scanf("%d%d",&a,&b);

		ins(a,b);ins(b,a);

	}

	dfs(1,0);int tot=0;

	for(int i=fa[n];i!=1;i=fa[i])tot++;

	int k=n;

	for(int i=1;i<=tot/2;i++)k=fa[k];

	int ls1=n-siz[k]-(tot-tot/2),ls2=siz[k]-tot/2;

	if(tot&1)

	{

		if(ls2<=ls1)puts("Fennec");

		else puts("Snuke");

	}

	else

	{

		if(ls1<=ls2)puts("Snuke");

		else puts("Fennec");

	}

	return 0;

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

}


// Faster C++ solution for the same problem (measured speedup: 3.892893124975019x):
#include<iostream>

#include<cstdio>

using namespace std;

int siz[101000],fa[101000];

int h[101000],nxt[201000],K=0,to[201000];

void ins(int u,int v){nxt[++K]=h[u];h[u]=K;to[K]=v;}

void dfs(int x,int f)

{

	fa[x]=f;siz[x]=1;

	for(int i=h[x];i;i=nxt[i])

	{

		if(to[i]==f)continue;

		dfs(to[i],x);siz[x]+=siz[to[i]];

	}

}

int main()

{

	int n;scanf("%d",&n);

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

	{

		int a,b;scanf("%d%d",&a,&b);

		ins(a,b);ins(b,a);

	}

	dfs(1,0);int tot=0;

	for(int i=fa[n];i!=1;i=fa[i])tot++;

	int k=n;

	for(int i=1;i<=tot/2;i++)k=fa[k];

	int ls1=n-siz[k]-(tot-tot/2),ls2=siz[k]-tot/2;

	if(tot&1)

	{

		if(ls2<=ls1)puts("Fennec");

		else puts("Snuke");

	}

	else

	{

		if(ls1<=ls2)puts("Snuke");

		else puts("Fennec");

	}

	return 0;

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

}

// Faster C++ solution for the same problem (measured speedup: 3.6029512708100904x):
#include <algorithm>

#include <bitset>

#include <cmath>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <deque>

#include <list>

#include <map>

#include <iomanip>

#include <iostream>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <utility>

#include <vector>

#define fi first

#define se second

#define pb push_back

//#define mp make_pair

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

using namespace std;

typedef long long LL;

typedef pair<int,int> pii;

const int INF=0x3f3f3f3f;

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

//const int MOD=998244353;

const int N=2e5+10;



inline int read(){

	int ww=1,xx=0;char ch=getchar();

	while(!isdigit(ch)){if(ch=='-') ww=-ww;ch=getchar();}

	while(isdigit(ch)){xx=(xx<<1)+(xx<<3)+(ch^48);ch=getchar();}

	return ww*xx;

}



int n=read();

int head[N];

int cnt;

int dist1[N],dist2[N],ans;



struct Edge{

	int to,nxt;

}ed[N];



void add_edge(int a,int b){

	ed[++cnt].to=b;

	ed[cnt].nxt=head[a];

	head[a]=cnt;

}



void dfs1(int u,int p){

	for(int i=head[u];i!=-1;i=ed[i].nxt){

		int v=ed[i].to;

		if(v!=p){

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

			dfs1(v,u);

		}

	}

}



void dfs2(int u,int p){

	for(int i=head[u];i!=-1;i=ed[i].nxt){

		int v=ed[i].to;

		if(v!=p){

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

			dfs2(v,u);

		}

	}

}



signed main(){

//	freopen(".in","r",stdin);

//	freopen(".out","w",stdout);

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

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

		int fr,to;

		fr=read();

		to=read();

		add_edge(fr,to);

		add_edge(to,fr);

	}

	dist1[1]=0;

	dist2[n]=0;

	dfs1(1,-1);

	dfs2(n,-1);

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

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

			ans++;

	if(ans>n-ans) puts("Fennec");

	else puts("Snuke");

	return 0;

}

/*

7

3 6

1 2

3 1

7 4

5 7

1 4



4

1 4

4 2

2 3

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



}


// Faster C++ solution for the same problem (measured speedup: 3.5951043456223153x):
#include <algorithm>

#include <bitset>

#include <cmath>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <deque>

#include <list>

#include <map>

#include <iomanip>

#include <iostream>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <utility>

#include <vector>

#define fi first

#define se second

#define pb push_back

//#define mp make_pair

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

using namespace std;

typedef long long LL;

typedef pair<int,int> pii;

const int INF=0x3f3f3f3f;

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

//const int MOD=998244353;

const int N=2e5+10;



inline int read(){

	int ww=1,xx=0;char ch=getchar();

	while(!isdigit(ch)){if(ch=='-') ww=-ww;ch=getchar();}

	while(isdigit(ch)){xx=(xx<<1)+(xx<<3)+(ch^48);ch=getchar();}

	return ww*xx;

}



int n=read();

int head[N];

int cnt;

int dist1[N],dist2[N],ans;



struct Edge{

	int to,nxt;

}ed[N];



void add_edge(int a,int b){

	ed[++cnt].to=b;

	ed[cnt].nxt=head[a];

	head[a]=cnt;

}



void dfs1(int u,int p){

	for(int i=head[u];i!=-1;i=ed[i].nxt){

		int v=ed[i].to;

		if(v!=p){

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

			dfs1(v,u);

		}

	}

}



void dfs2(int u,int p){

	for(int i=head[u];i!=-1;i=ed[i].nxt){

		int v=ed[i].to;

		if(v!=p){

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

			dfs2(v,u);

		}

	}

}



signed main(){

//	freopen(".in","r",stdin);

//	freopen(".out","w",stdout);

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

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

		int fr,to;

		fr=read();

		to=read();

		add_edge(fr,to);

		add_edge(to,fr);

	}

	dist1[1]=0;

	dist2[n]=0;

	dfs1(1,-1);

	dfs2(n,-1);

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

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

			ans++;

	if(ans>n-ans) puts("Fennec");

	else puts("Snuke");

	return 0;

}

/*

7

3 6

1 2

3 1

7 4

5 7

1 4



4

1 4

4 2

2 3

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

}


// Faster C++ solution for the same problem (measured speedup: 3.9031884583969347x):
#include <algorithm>

#include <bitset>

#include <cmath>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <deque>

#include <list>

#include <map>

#include <iomanip>

#include <iostream>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <utility>

#include <vector>

#define fi first

#define se second

#define pb push_back

//#define mp make_pair

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

using namespace std;

typedef long long LL;

typedef pair<int,int> pii;

const int INF=0x3f3f3f3f;

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

//const int MOD=998244353;

const int N=2e5+10;



inline int read(){

	int ww=1,xx=0;char ch=getchar();

	while(!isdigit(ch)){if(ch=='-') ww=-ww;ch=getchar();}

	while(isdigit(ch)){xx=(xx<<1)+(xx<<3)+(ch^48);ch=getchar();}

	return ww*xx;

}



int n=read();

int head[N];

int cnt;

int dist1[N],dist2[N],ans;



struct Edge{

	int to,nxt;

}ed[N];



void add_edge(int a,int b){

	ed[++cnt].to=b;

	ed[cnt].nxt=head[a];

	head[a]=cnt;

}



void dfs1(int u,int p){

	for(int i=head[u];i!=-1;i=ed[i].nxt){

		int v=ed[i].to;

		if(v!=p){

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

			dfs1(v,u);

		}

	}

}



void dfs2(int u,int p){

	for(int i=head[u];i!=-1;i=ed[i].nxt){

		int v=ed[i].to;

		if(v!=p){

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

			dfs2(v,u);

		}

	}

}



signed main(){

//	freopen(".in","r",stdin);

//	freopen(".out","w",stdout);

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

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

		int fr,to;

		fr=read();

		to=read();

		add_edge(fr,to);

		add_edge(to,fr);

	}

	dist1[1]=0;

	dist2[n]=0;

	dfs1(1,-1);

	dfs2(n,-1);

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

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

			ans++;

	if(ans>n-ans) puts("Fennec");

	else puts("Snuke");

	return 0;

}

/*

7

3 6

1 2

3 1

7 4

5 7

1 4



4

1 4

4 2

2 3

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

}

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

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



}


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

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

}


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

}