stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int INF=1000000007;

vector<int> g[100005];

int dist1[100005],dist2[100005];

int main()

{

	int n;

	cin>>n;

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

	{

		int a,b;

		cin>>a>>b;

		a--;

		b--;

		g[a].push_back(b);

		g[b].push_back(a);

	}

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

		dist1[i]=INF,dist2[i]=INF;

	queue<int> q;

	q.push(0);

	dist1[0]=0;

	while(!q.empty())

	{

		int f=q.front();

		q.pop();

		for(int i=0;i<g[f].size();i++)

		{

			int s=g[f][i];

			if(dist1[s]==INF)

			{

				dist1[s]=dist1[f]+1;

				q.push(s);

			}

		}

	}

	q.push(n-1);

	dist2[n-1]=0;

	while(!q.empty())

	{

		int f=q.front();

		q.pop();

		for(int i=0;i<g[f].size();i++)

		{

			int s=g[f][i];

			if(dist2[s]==INF)

			{

				dist2[s]=dist2[f]+1;

				q.push(s);

			}

		}

	}

	int s1=0,s2=0;

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

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

			s1++;

		else

			s2++;

	if(s1>s2)

		cout<<"Fennec"<<endl;

	else

		cout<<"Snuke"<<endl;

	return 0;

}

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

#include<string>

#include<stdlib.h> 

#include<cstring>

#include<map>

#include<list>

#include<stdio.h>

#include<cmath>

#include<iomanip>

#include<bitset>

#include<vector>

#include<time.h>

#include<algorithm> 

#include<queue>

#include<set>

#include<deque>

#define mod 1e9+7

#define inf 1e18 

typedef long long ll;

typedef long double ld;

using namespace std;

typedef list<ll> li;

typedef list<ll>::iterator lt;

li sh_r;

ll N,s;

vector<li>a;

bool dfs(ll step,ll x,ll f){

	if(x>N)cout<<f<<" "<<x<<endl;

	if(x==N){

	  s=step;

	  return true;

    }

	for(lt it=a[x].begin();it!=a[x].end();it++){

		if(*it==f)continue;

		if(dfs(step+1,*it,x)){

			sh_r.push_back(x);

			return true;

		}

	}

	return false;

}

ll num(ll x,ll f){

	ll n=1;

	for(lt it=a[x].begin();it!=a[x].end();it++){

		if(*it==f)continue;

		n+=num(*it,x);

	}

	return n;

}

int main(){	

    cin>>N;

    a.resize(N+10);

    for(ll K=1;K<N;K++){

    	ll x,y;

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

    	a[x].push_back(y);

    	a[y].push_back(x);

	}

	dfs(0,1,-1);

	s--;

	ll F=1,S=N;

	if(N!=2){

		ll j=s/2;

		for(lt it=sh_r.begin();it!=sh_r.end();it++){

			j--;

			if(j==0)S=*it;

			if(j==-1){

				F=*it;

				break;

			}

		}

	}

	ll Fen=num(F,S);

	ll Snu=num(S,F);

	if(Fen>Snu)printf("Fennec");

	else printf("Snuke");

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>

using namespace std;

#define ll long long 

int n;

vector<int> g[100005];

int d1[100005],d2[100005];

inline void dfs(int r,int f,int d,int dist[])

{

    dist[r]=d;

    for(int x=0;x<g[r].size();x++){

        if(g[r][x]!=f){

        	dfs(g[r][x],r,d+1,dist);

		}

    }

}

int main()

{

    cin>>n;

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

    {

    	int a,b;

        cin>>a>>b;

        a--,b--;

        g[a].push_back(b);

        g[b].push_back(a);

    }

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

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

    int ans=0;

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

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

            ans++;

		}

        else{

        	ans--;

        }

    }

    if(ans>0){

    	cout <<"Fennec"<< endl;

	}

    else{

    	cout<<"Snuke"<<endl;

	}

    return 0;

}

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

#include <cstring>

using namespace std;



int first[100003], next[200003], node[200003], n, len, ans[3], m;

char fs[100003];

bool vis[100003];



inline void readin(int n)

{

    int p = 1;

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

    {

        int u, v;

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

        next[p] = first[u];

        first[u] = p;

        node[p] = v;

        ++p;

        next[p] = first[v];

        first[v] = p;

        node[p] = u;

        ++p;

    }

}



bool dfs(int x, int deep)

{

    vis[x] = true;

    if (x == n)

    {

        len = deep >> 1;

        fs[n] = 2;

        ++ans[2];

        return true;

    }

    int t = first[x];

    while (t)

    {

        if (!vis[node[t]])

        {

            if (dfs(node[t], deep + 1))

            {

                if (deep > len)

                {

                    fs[x] = 2;

                    ++ans[2];

                }

                else

                {

                    fs[x] = 1;

                    ++ans[1];

                }

                return true;

            }

        }

        t = next[t];

    }

    return false;

}



void ddfs(int x)

{

    int t = first[x];

    while (t)

    {

        if (fs[node[t]] == 0)

        {

            ++ans[m];

            fs[node[t]] = m;

            ddfs(node[t]);

        }

        t = next[t];

    }

}



void init()

{

    memset(first, 0, sizeof first);

    memset(ans, 0, sizeof ans);

    memset(fs, 0, sizeof fs);

    memset(vis, false, sizeof vis);

}



int main()

{

    while (scanf("%d", &n) != EOF)

    {

        readin(n);

        dfs(1, 0);

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

        {

            if (fs[i])

            {

                m = fs[i];

                ddfs(i);

            }

        }

        printf("%s\n", ans[1] > ans[2] ? "Fennec" : "Snuke");

        init();

    }

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <cstdio>

#include <vector>

#include <queue>

#include <list>

#include <cstdlib>

#include <algorithm>

#include <set>

#include <map>

#include <deque>

#include <cstring>

#include <cmath>

//#include<bits/stdc++.h>

using namespace std;



const int INF=0x3f3f3f3f;

const int SIZE=100005;



vector<int> mp[SIZE];

int color[SIZE],dist[SIZE],dist2[SIZE];



void bfs(int s,int dist[]){

	queue<int> que;

	que.push(s);

	while(!que.empty()){

		int u=que.front();

		que.pop();

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

			int t=mp[u][i];

			if(dist[t] || t==s) continue;

			dist[t]=dist[u]+1;

			que.push(t);

		}

	}

}



int main(){

	int n;

	scanf("%d",&n);

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

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

		a--;

		b--;

		mp[a].push_back(b);

		mp[b].push_back(a);

	}

	bfs(0,dist);

	bfs(n-1,dist2);

	int s=0,f=0;

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

		if(dist[i]<=dist2[i]) f++; else s++;

	}

	if(s>=f){

		puts("Snuke");

	}

	else{

		puts("Fennec");

	}

	return 0;

}


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

#include <cstring>

using namespace std;



int first[100003], next[200003], node[200003], n, len, ans[3], m;

char fs[100003];

bool vis[100003];



inline void readin(int n)

{

    int p = 1;

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

    {

        int u, v;

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

        next[p] = first[u];

        first[u] = p;

        node[p] = v;

        ++p;

        next[p] = first[v];

        first[v] = p;

        node[p] = u;

        ++p;

    }

}



bool dfs(int x, int deep)

{

    vis[x] = true;

    if (x == n)

    {

        len = deep >> 1;

        fs[n] = 2;

        ++ans[2];

        return true;

    }

    int t = first[x];

    while (t)

    {

        if (!vis[node[t]])

        {

            if (dfs(node[t], deep + 1))

            {

                if (deep > len)

                {

                    fs[x] = 2;

                    ++ans[2];

                }

                else

                {

                    fs[x] = 1;

                    ++ans[1];

                }

                return true;

            }

        }

        t = next[t];

    }

    return false;

}



void ddfs(int x)

{

    int t = first[x];

    while (t)

    {

        if (fs[node[t]] == 0)

        {

            ++ans[m];

            fs[node[t]] = m;

            ddfs(node[t]);

        }

        t = next[t];

    }

}



void init()

{

    memset(first, 0, sizeof first);

    memset(ans, 0, sizeof ans);

    memset(fs, 0, sizeof fs);

    memset(vis, false, sizeof vis);

}



int main()

{

    while (scanf("%d", &n) != EOF)

    {

        readin(n);

        dfs(1, 0);

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

        {

            if (fs[i])

            {

                m = fs[i];

                ddfs(i);

            }

        }

        printf("%s\n", ans[1] > ans[2] ? "Fennec" : "Snuke");

        init();

    }

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int INF=1000000007;

vector<int> g[100005];

int dist1[100005],dist2[100005];

int main()

{

	int n;

	cin>>n;

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

	{

		int a,b;

		cin>>a>>b;

		a--;

		b--;

		g[a].push_back(b);

		g[b].push_back(a);

	}

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

		dist1[i]=INF,dist2[i]=INF;

	queue<int> q;

	q.push(0);

	dist1[0]=0;

	while(!q.empty())

	{

		int f=q.front();

		q.pop();

		for(int i=0;i<g[f].size();i++)

		{

			int s=g[f][i];

			if(dist1[s]==INF)

			{

				dist1[s]=dist1[f]+1;

				q.push(s);

			}

		}

	}

	q.push(n-1);

	dist2[n-1]=0;

	while(!q.empty())

	{

		int f=q.front();

		q.pop();

		for(int i=0;i<g[f].size();i++)

		{

			int s=g[f][i];

			if(dist2[s]==INF)

			{

				dist2[s]=dist2[f]+1;

				q.push(s);

			}

		}

	}

	int s1=0,s2=0;

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

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

			s1++;

		else

			s2++;

	if(s1>s2)

		cout<<"Fennec"<<endl;

	else

		cout<<"Snuke"<<endl;

	return 0;

}

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

#include <cstring>

using namespace std;



int first[100003], next[200003], node[200003], n, len, ans[3], m;

char fs[100003];

bool vis[100003];



inline void readin(int n)

{

    int p = 1;

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

    {

        int u, v;

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

        next[p] = first[u];

        first[u] = p;

        node[p] = v;

        ++p;

        next[p] = first[v];

        first[v] = p;

        node[p] = u;

        ++p;

    }

}



bool dfs(int x, int deep)

{

    vis[x] = true;

    if (x == n)

    {

        len = deep >> 1;

        fs[n] = 2;

        ++ans[2];

        return true;

    }

    int t = first[x];

    while (t)

    {

        if (!vis[node[t]])

        {

            if (dfs(node[t], deep + 1))

            {

                if (deep > len)

                {

                    fs[x] = 2;

                    ++ans[2];

                }

                else

                {

                    fs[x] = 1;

                    ++ans[1];

                }

                return true;

            }

        }

        t = next[t];

    }

    return false;

}



void ddfs(int x)

{

    int t = first[x];

    while (t)

    {

        if (fs[node[t]] == 0)

        {

            ++ans[m];

            fs[node[t]] = m;

            ddfs(node[t]);

        }

        t = next[t];

    }

}



void init()

{

    memset(first, 0, sizeof first);

    memset(ans, 0, sizeof ans);

    memset(fs, 0, sizeof fs);

    memset(vis, false, sizeof vis);

}



int main()

{

    while (scanf("%d", &n) != EOF)

    {

        readin(n);

        dfs(1, 0);

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

        {

            if (fs[i])

            {

                m = fs[i];

                ddfs(i);

            }

        }

        printf("%s\n", ans[1] > ans[2] ? "Fennec" : "Snuke");

        init();

    }

}
// Slower C++ solution:
#include <iostream>

#include <vector>

using namespace std;

#define ll long long 

int n;

vector<int> g[100005];

int d1[100005],d2[100005];

inline void dfs(int r,int f,int d,int dist[])

{

    dist[r]=d;

    for(int x=0;x<g[r].size();x++){

        if(g[r][x]!=f){

        	dfs(g[r][x],r,d+1,dist);

		}

    }

}

int main()

{

    cin>>n;

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

    {

    	int a,b;

        cin>>a>>b;

        a--,b--;

        g[a].push_back(b);

        g[b].push_back(a);

    }

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

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

    int ans=0;

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

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

            ans++;

		}

        else{

        	ans--;

        }

    }

    if(ans>0){

    	cout <<"Fennec"<< endl;

	}

    else{

    	cout<<"Snuke"<<endl;

	}

    return 0;

}

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

#include <cstring>

#include <queue>

using namespace std;

const int maxn = 1e5 + 10;

const int maxm = 1e5 + 10;

struct edge{

	int to;

	int next;

}Edge[2 * maxm];

int head[maxn], pos, n, color[maxn];

void init(){

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

	for(int i = 0; i < maxn; i++) color[i] = -1; // -1 is uncolored 1 is whrite, 0 is black

	pos = 0;

}

void addEdge(int u, int v){

	Edge[pos].to = v;

	Edge[pos].next = head[u];

	head[u] = pos;

	pos++;

}

void BFS(){

	queue <int> q;

	color[1] = 0;

	color[n] = 1;

	q.push(1);

	q.push(n);

	while(!q.empty()){

		int h = q.front();

		q.pop();

		for(int i = head[h]; i != -1; i = Edge[i].next){

			if(color[Edge[i].to] == -1){

				color[Edge[i].to] = color[h];

				q.push(Edge[i].to);

			}

		}

	}

}

// void BFS(){

// 	queue <int> qw;

// 	queue <int> qb;

// 	qw.push(n);

// 	color[n] = 1;

// 	qb.push(1);

// 	color[1] = 0;

// 	while(!qw.empty() || !qb.empty()){

// 		if(!qb.empty()){

// 			int h = qb.front();

// 			//cout << "B" << h << endl;

// 			qb.pop();

// 			for(int i = head[h]; i != -1; i = Edge[i].next){

// 				if(color[Edge[i].to] == -1){

// 					//cout << Edge[i].to << " ";

// 					color[Edge[i].to] = 0;

// 					qb.push(Edge[i].to);

// 				}

// 			}

// 			//cout << endl;

// 		}

// 		if(!qw.empty()){

// 			int h = qw.front();

// 			//cout << "W" << h << endl;

// 			qw.pop();

// 			for(int i = head[h]; i != -1; i = Edge[i].next){

// 				if(color[Edge[i].to] == -1){

// 					//cout << Edge[i].to << " ";

// 					color[Edge[i].to] = 1;

// 					qw.push(Edge[i].to);

// 				}

// 			}

// 			//cout << endl;

// 		}

// 	}



// }

int main(){

	//freopen("input.txt", "r", stdin);

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

		init();

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

			int u, v;

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

			addEdge(u, v);

			addEdge(v, u);

		}

		//cout << n << endl;

		BFS();

		int white = 0, black = 0;

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

			//cout << i << ":"<< color[i] << endl;

			if(color[i] == 1) white++;

			else black++;

		}

		//cout << white <<" "<< black << endl;

		if(white < black) printf("Fennec\n");

		else printf("Snuke\n");

	}

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<vector>

#include<queue>

using namespace std;

const int cc=100005;

vector<int>poi[cc];

int color[cc]={0},cnt[2];

int main()

{

	queue<int>clr;

	int n,a,b;

	cin>>n;

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

	{

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

		poi[a].push_back(b);

		poi[b].push_back(a);

	}

	color[1]=1;

	color[n]=2;

	clr.push(1);

	clr.push(n);

	while(!clr.empty())

	{

		int tmp=clr.front();

		clr.pop();

		cnt[color[tmp]-1]++;

		for(int i=0;i<poi[tmp].size();i++)

		{

			if(color[poi[tmp][i]]) continue;

			color[poi[tmp][i]]=color[tmp];

			clr.push(poi[tmp][i]);

		}

	}

	if(cnt[0]>cnt[1]) cout<<"Fennec\n";

	else cout<<"Snuke\n";

	return 0;

}

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

#include <cstring>

#include <queue>

using namespace std;

const int maxn = 1e5 + 10;

const int maxm = 1e5 + 10;

struct edge{

	int to;

	int next;

}Edge[2 * maxm];

int head[maxn], pos, n, color[maxn];

void init(){

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

	for(int i = 0; i < maxn; i++) color[i] = -1; // -1 is uncolored 1 is whrite, 0 is black

	pos = 0;

}

void addEdge(int u, int v){

	Edge[pos].to = v;

	Edge[pos].next = head[u];

	head[u] = pos;

	pos++;

}

void BFS(){

	queue <int> q;

	color[1] = 0;

	color[n] = 1;

	q.push(1);

	q.push(n);

	while(!q.empty()){

		int h = q.front();

		q.pop();

		for(int i = head[h]; i != -1; i = Edge[i].next){

			if(color[Edge[i].to] == -1){

				color[Edge[i].to] = color[h];

				q.push(Edge[i].to);

			}

		}

	}

}

// void BFS(){

// 	queue <int> qw;

// 	queue <int> qb;

// 	qw.push(n);

// 	color[n] = 1;

// 	qb.push(1);

// 	color[1] = 0;

// 	while(!qw.empty() || !qb.empty()){

// 		if(!qb.empty()){

// 			int h = qb.front();

// 			//cout << "B" << h << endl;

// 			qb.pop();

// 			for(int i = head[h]; i != -1; i = Edge[i].next){

// 				if(color[Edge[i].to] == -1){

// 					//cout << Edge[i].to << " ";

// 					color[Edge[i].to] = 0;

// 					qb.push(Edge[i].to);

// 				}

// 			}

// 			//cout << endl;

// 		}

// 		if(!qw.empty()){

// 			int h = qw.front();

// 			//cout << "W" << h << endl;

// 			qw.pop();

// 			for(int i = head[h]; i != -1; i = Edge[i].next){

// 				if(color[Edge[i].to] == -1){

// 					//cout << Edge[i].to << " ";

// 					color[Edge[i].to] = 1;

// 					qw.push(Edge[i].to);

// 				}

// 			}

// 			//cout << endl;

// 		}

// 	}



// }

int main(){

	//freopen("input.txt", "r", stdin);

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

		init();

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

			int u, v;

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

			addEdge(u, v);

			addEdge(v, u);

		}

		//cout << n << endl;

		BFS();

		int white = 0, black = 0;

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

			//cout << i << ":"<< color[i] << endl;

			if(color[i] == 1) white++;

			else black++;

		}

		//cout << white <<" "<< black << endl;

		if(white < black) printf("Fennec\n");

		else printf("Snuke\n");

	}

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

//template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

  

/* attention

    long longのシフト演算には気をつけよう

    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも

    sizeは(int)とキャストしよう

    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？

*/



const int inf = 1<<29;

int N;

vector<int> fromFen(100005, inf), fromSun(100005, inf);

bool seen[100005];

vector<int> adj[100005];



void bfs(string mode, vector<int> &d){

    queue<int> q;

    for(int i=0; i<N; i++) seen[i] = false;

    if(mode == "f") { q.push(N-1); seen[N-1] = true; }

    else { q.push(0); seen[0] = true; }



    while(!q.empty()){

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

        for(auto to : adj[now]){

            if(!seen[to]){

                seen[to] = true;

                d[to] = d[now]+1;

                q.push(to);

            }

        }

    }

}



int main(){

    cin >> N;

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

        int a, b; cin >> a >> b;

        a--; b--;

        adj[a].push_back(b);

        adj[b].push_back(a);

    }



    fromSun[0] = fromFen[N-1] = 0;

    bfs("f", fromFen);

    bfs("s", fromSun);



    int sun = 0, fen = 0;

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

        if(fromSun[i] <= fromFen[i]) sun++;

        else fen++; 

    }



    if(sun > fen) cout << "Fennec" << endl;

    else cout << "Snuke" << endl;



    // for(int i=0; i<N; i++) cout << fromSun[i] << endl;

    // cout << endl;

    // for(int i=0; i<N; i++) cout << fromFen[i] << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.231649375599098x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

//template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

 

/* attention

    long longのシフト演算には気をつけよう

    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも

    sizeは(int)とキャストしよう

    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？

*/



const int inf = 1<<29;



int from_fen[100005], from_snu[100005];

vector<int> adj[100005];



void bfs(int d[], int start){

    queue<int> q;

    d[start] = 0;

    q.push(start);



    while(!q.empty()){

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

        for(int to:adj[now]){

            if(d[to] != inf) continue;

            d[to] = d[now]+1;

            q.push(to);

        }

    }

}



int main(){

    int N; cin >> N;

    for(int i=0; i<N; ++i) { from_fen[i] = inf; from_snu[i] = inf; }

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

        int a, b; cin >> a >> b;

        --a; --b;

        adj[a].push_back(b);

        adj[b].push_back(a);

    }



    bfs(from_fen, 0);

    bfs(from_snu, N-1);



    int fen = 0, snu = 0;

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

        if(from_fen[i] <= from_snu[i]) ++fen;

        else ++snu;

    }



    if(fen > snu) cout << "Fennec" << endl;

    else cout << "Snuke" << endl;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

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

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

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define Would

#define you

#define please



//木はdfsのほうが書くのはやいかなぁ

vector<int> eda[100001];

int kyoriF[100001];

int kyoriS[100001];



void sagasuF(int A, int B) {

	if (!kyoriF[A]) {

		kyoriF[A] = B;

		for (auto itr : eda[A]) sagasuF(itr, B + 1);

	}

}

void sagasuS(int A, int B) {

	if (!kyoriS[A]) {

		kyoriS[A] = B;

		for (auto itr : eda[A]) sagasuS(itr, B + 1);

	}

}



int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);



	int N;

	cin >> N;

	rep(i, N - 1) {

		int a, b;

		cin >> a >> b;

		eda[a].push_back(b);

		eda[b].push_back(a);

	}



	sagasuF(1, 1);

	sagasuS(N, 1);



	int fen = 0;

	rep1(i, N) if (kyoriF[i] <= kyoriS[i]) fen++;



	if (fen > N - fen) co("Fennec");

	else co("Snuke");



	Would you please return 0;

}

// Faster C++ solution for the same problem (measured speedup: 19.093093241687058x):
//#include<bits/stdc++.h>

#include<cstdio>

#include<algorithm>

using namespace std;

typedef long long ll;

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

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

#define co(x) cout << (x) << "\n"

#define cosp(x) cout << (x) << " "

#define ce(x) cerr << (x) << "\n"

#define cesp(x) cerr << (x) << " "

#define pb push_back

#define mp make_pair

#define Would

#define you

#define please



const int cm = 1 << 17;

char cn[cm], * ci = cn + cm, ct;

inline char getcha() {

	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }

	return *ci++;

}

inline int getint() {

	int A = 0;

	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';

	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';

	return A;

}



int N;

int E[200001], n[200001], H[100001];

ll k[100001];

int D[100001];

ll dfs(int p, int mae, int d) {

	D[p] = d;

	ll kazu = 1;

	if (p == N) kazu += 1ll << 32;

	for (int i = H[p]; i; i = n[i]) if (E[i] != mae) kazu += dfs(E[i], p, d + 1);

	return k[p] = kazu;

}



int main() {

	//cin.tie(0);

	//ios::sync_with_stdio(false);





	N = getint();

	int kari = 1;

	rep(i, N - 1) {

		int a = getint(), b = getint();

		E[kari] = b;

		n[kari] = H[a];

		H[a] = kari++;

		E[kari] = a;

		n[kari] = H[b];

		H[b] = kari++;

	}



	dfs(1, 0, 1);



	int kyori = (D[N] + 1) / 2;

	ll kotae = 0;

	rep1(i, N) if (k[i] > (1ll << 32) && D[i] > kyori) kotae = max(kotae, k[i] - (1ll << 32));



	if (N - kotae > kotae) printf("Fennec");

	else printf("Snuke");



	Would you please return 0;

}