stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

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

}

// Optimized solution to the same problem (faster):
//#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_unlocked(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];

int kyori, kotae;

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

	int kazu = 1;

	if (p == N) {

		kazu += 1 << 20;

		kyori = (d + 1) / 2;

	}

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

	if (kazu > (1 << 20) && d == kyori + 1) kotae = kazu - (1 << 20);

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



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

	else printf("Snuke");



	Would you please return 0;

}

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

using namespace std;

int f[100005],n,a[100005],pp[100005];

vector<int> v[100005];

queue<int> lj;

void dfs(int w,int p){

	if(pp[w])return;

	a[p]=w;pp[w]=1;

	if(w==n){

		for(int i=1;i<=p;i++)lj.push(a[i]);

		return;

	}

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

		dfs(v[w][i],p+1);

	}

}

int ans;

void df(int p){

	if(f[p]==2||pp[p])return;

	f[p]=1;pp[p]=1;

	ans++;

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

		df(v[p][i]);

	}

}

int main(){

	cin>>n;

	int x,y;

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

		cin>>x>>y;

		v[x].push_back(y);

		v[y].push_back(x);

	}

	dfs(1,1);

	int t=lj.size();

	for(int i=0;i<(t+1)>>1;i++){

		f[lj.front()]=1;lj.pop();

	}

	for(int i=0;i<lj.size();i++){

		f[lj.front()]=2;lj.pop();

	}

	memset(pp,0,sizeof(pp));

	df(1);

	if(ans>n/2)cout<<"Fennec";

	else cout<<"Snuke";

	return 0;

}

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

#define ri register int

using namespace std;

int n,f[2][100005],k,x,y,fen;

vector<int>g[100005];

void dfs(int u,int fa){

    f[k][u]=f[k][fa]+1;

    for(ri i=0;i<g[u].size();++i)

    if(g[u][i]!=fa)dfs(g[u][i],u);

}int main(){

    scanf("%d",&n);

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

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

        g[x].push_back(y);

        g[y].push_back(x);

    }k=0;dfs(1,0);k=1;dfs(n,0);

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

    if(f[0][i]<=f[1][i])++fen;

	if(fen>n/2)puts("Fennec");

    else puts("Snuke");

    return 0;

}

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



using namespace std;





int us[200005],n,m=0,c[200005],a1=0,a2=0;

vector<int>e[100005];

void dfs(int v,int l)

{

    int i;

    if(v==n)

    {

        m=l;

        return ;

    }

    for(i=0;i<e[v].size();i++)

    {

        if(us[e[v][i]]==0)

        {

            us[e[v][i]]=1;

            dfs(e[v][i],l+1);

        }

        if(m>0)

        {

            if(l<=m/2)

            {

                c[v]=1;

            }

            else

            {

                c[v]=-1;

            }

            return ;

        }

    }

}

void dfs1(int v)

{

    if(c[v]==-1)

    {

        return ;

    }

    a1++;

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

    {

        if(us[e[v][i]]==0)

        {

            us[e[v][i]]=1;

            dfs1(e[v][i]);

        }

    }

}

void dfs2(int v)

{

    if(c[v]==1)

    {

        return ;

    }

    a2++;

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

    {

        if(us[e[v][i]]==0)

        {

            us[e[v][i]]=1;

            dfs2(e[v][i]);

        }

    }

}

int main()

{

    int i,a,b;

    scanf("%d",&n);

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

    {

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

        e[a].push_back(b);

        e[b].push_back(a);

    }

    c[1]=1;

    c[n]=-1;

    dfs(1,0);

    us[1]=1;

    memset(us,0,sizeof(us));

    dfs1(1);

    us[1]=1;

    memset(us,0,sizeof(us));

    dfs2(n);

    us[1]=1;

    if(a1>a2)

    {

        printf("Fennec\n");

    }

    else

    {

        printf("Snuke\n");

    }

    return 0;

}


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

#include<vector>

#include<queue>

using namespace std;

vector<int> G[100001];

int dis[2][100001];

void bfs(int j,int start)

{

	dis[j][start]=1;

	int now,i;

	queue<int> q;

	q.push(start);

	while(!q.empty())

	{

		now=q.front();

		q.pop();

		for(i=0;i<G[now].size();i++)

		{

			if(dis[j][G[now][i]]==0)

			{

				dis[j][G[now][i]]=dis[j][now]+1;

				q.push(G[now][i]);

			}

		}

	}

}

int main()

{

	int n,i,j,s,e;

	scanf("%d",&n);

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

	{

		scanf("%d%d",&s,&e);

		G[s].push_back(e);

		G[e].push_back(s);

	}

	bfs(0,1);

	bfs(1,n);

	s=0,e=0;

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

	{

		if(dis[0][i]<=dis[1][i])

			s++;

		else

			e++;

	}

	if(s>e)

		printf("Fennec");

	else

		printf("Snuke");

	return 0;

}

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

#include <bits/stdc++.h>

using namespace std;

vector < int > g[200005];

int n,dist1[200005],dist2[200005];

void dfs1(int pos,int depth)

{

	if(dist1[pos] != -1)

		return;

	dist1[pos] = depth;

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

		dfs1(g[pos][i],depth + 1);

}

void dfs2(int pos,int depth)

{

	if(dist2[pos] != -1)

		return;

	dist2[pos] = depth;

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

		dfs2(g[pos][i],depth + 1);

}

int main()

{

	cin >> n;

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

	{

		int x,y;

		cin >> x >> y;

		g[x].push_back(y);

		g[y].push_back(x);

	}

	memset(dist1,-1,sizeof(dist1));

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

	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)

		puts("Fennec");

	else

		puts("Snuke");

	return 0;

}

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

#include<queue>

#include<vector>

#include<bits/stdc++.h>

using namespace std;

const int MAXN=100000+10;

vector<int> edge[MAXN];

int n,cnt[3];

int tree[MAXN];

void bfs()

{

    queue<int> q;

    q.push(1),q.push(n);

    while(!q.empty())

    {

        int temp=q.front();

        q.pop();

        cnt[tree[temp]]++;

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

        {

            int v=edge[temp][i];

            if(tree[v])continue;

            else tree[v]=tree[temp];

            q.push(v);

        }

    }

}



int main()

{

    memset(tree,0,sizeof(tree));

    cin>>n;

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

    {

        int x,y;

        cin>>x>>y;

        edge[x].push_back(y);

        edge[y].push_back(x);

    }

    tree[1]=1,tree[n]=2;

    bfs();

    if(cnt[2]>=cnt[1])

        cout<<"Snuke"<<endl;

    else

        cout<<"Fennec"<<endl;

    return 0;

}

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

#include<vector>

#include<algorithm>

#include<list>

#include<set>

using namespace std;



int n;



vector<int> fenech(1000001);

vector<int> sunuke(1000001);

set<int> se;



void dfs(int c,int depth,vector<vector<int> >& tree,bool f){



	if(f){

		fenech[c] = depth;

	}else{

		sunuke[c] = depth;

	}



	for(int i=0;i<tree[c].size();++i){

		int next = tree[c][i];

		if(se.find(next) != se.end()) continue;

		se.insert(next);

		dfs(next,depth+1,tree,f);

	}

}





int main(){

	cin >> n;

	vector<vector<int> > tree(n+1);



	int a,b;

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

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}



	se.insert(1);

	dfs(1,0,tree,true);

	se.clear();

	se.insert(n);

	dfs(n,0,tree,false);



	int nfenech = 0;

	int nsunuke = 0;



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

		if(fenech[i] <= sunuke[i]){

			nfenech++;

		}else{

			nsunuke++;

		}

	}



	if(nfenech > nsunuke) cout << "Fennec" <<endl;

	else cout << "Snuke" <<endl;

	

	return 0;

}






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

#include<vector>

#include<algorithm>

#include<list>

#include<set>

using namespace std;







void dfs(int c,int depth,vector<vector<int> >& tree, vector<int>& memo){

	if(memo[c] != -1) return;

	memo[c] = depth;



	for(int i=0;i<tree[c].size();++i){

		int next = tree[c][i];

		dfs(next,depth+1,tree,memo);

	}

}





int main(){

	int n;

	cin >> n;

	vector<vector<int> > tree(n+1);

	vector<int> fenech(n+1,-1);

	vector<int> sunuke(n+1,-1);



	int a,b;

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

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}



	dfs(1,0,tree,fenech);

	dfs(n,0,tree,sunuke);



	int nfenech = 0;

	int nsunuke = 0;



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

		if(fenech[i] <= sunuke[i]){

			nfenech++;

		}else{

			nsunuke++;

		}

	}



	if(nfenech > nsunuke) cout << "Fennec" <<endl;

	else cout << "Snuke" <<endl;

	

	return 0;

}






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

#include<vector>

#include<algorithm>

#include<list>

#include<set>

using namespace std;



int n;



vector<int> fenech(1000001,-1);

vector<int> sunuke(1000001,-1);

set<int> se;



void dfs(int c,int depth,vector<vector<int> >& tree, vector<int>& memo){

	if(memo[c] != -1) return;

	memo[c] = depth;



	for(int i=0;i<tree[c].size();++i){

		int next = tree[c][i];

		dfs(next,depth+1,tree,memo);

	}

}





int main(){

	cin >> n;

	vector<vector<int> > tree(n+1);



	int a,b;

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

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}



	se.insert(1);

	dfs(1,0,tree,fenech);

	se.clear();

	se.insert(n);

	dfs(n,0,tree,sunuke);



	int nfenech = 0;

	int nsunuke = 0;



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

		if(fenech[i] <= sunuke[i]){

			nfenech++;

		}else{

			nsunuke++;

		}

	}



	if(nfenech > nsunuke) cout << "Fennec" <<endl;

	else cout << "Snuke" <<endl;

	

	return 0;

}






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

#include<vector>

#include<algorithm>

#include<list>

#include<set>

using namespace std;







void dfs(int c,int depth,vector<vector<int> >& tree, vector<int>& memo){

	if(memo[c] != -1) return;

	memo[c] = depth;



	for(int i=0;i<tree[c].size();++i){

		int next = tree[c][i];

		dfs(next,depth+1,tree,memo);

	}

}





int main(){

	int n;

	cin >> n;

	vector<vector<int> > tree(n+1);

	vector<int> fenech(n+1,-1);

	vector<int> sunuke(n+1,-1);



	int a,b;

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

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}



	dfs(1,0,tree,fenech);

	dfs(n,0,tree,sunuke);



	int nfenech = 0;

	int nsunuke = 0;



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

		if(fenech[i] <= sunuke[i]){

			nfenech++;

		}else{

			nsunuke++;

		}

	}



	if(nfenech > nsunuke) cout << "Fennec" <<endl;

	else cout << "Snuke" <<endl;

	

	return 0;

}






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

#include<vector>

#include<algorithm>

#include<list>

#include<set>

using namespace std;



int n;



vector<int> fenech(1000001,-1);

vector<int> sunuke(1000001,-1);



void dfs(int c,int depth,vector<vector<int> >& tree, vector<int>& memo){

	if(memo[c] != -1) return;

	memo[c] = depth;



	for(int i=0;i<tree[c].size();++i){

		int next = tree[c][i];

		dfs(next,depth+1,tree,memo);

	}

}





int main(){

	cin >> n;

	vector<vector<int> > tree(n+1);



	int a,b;

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

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}



	dfs(1,0,tree,fenech);

	dfs(n,0,tree,sunuke);



	int nfenech = 0;

	int nsunuke = 0;



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

		if(fenech[i] <= sunuke[i]){

			nfenech++;

		}else{

			nsunuke++;

		}

	}



	if(nfenech > nsunuke) cout << "Fennec" <<endl;

	else cout << "Snuke" <<endl;

	

	return 0;

}






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

#include<vector>

#include<algorithm>

#include<list>

#include<set>

using namespace std;







void dfs(int c,int depth,vector<vector<int> >& tree, vector<int>& memo){

	if(memo[c] != -1) return;

	memo[c] = depth;



	for(int i=0;i<tree[c].size();++i){

		int next = tree[c][i];

		dfs(next,depth+1,tree,memo);

	}

}





int main(){

	int n;

	cin >> n;

	vector<vector<int> > tree(n+1);

	vector<int> fenech(n+1,-1);

	vector<int> sunuke(n+1,-1);



	int a,b;

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

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}



	dfs(1,0,tree,fenech);

	dfs(n,0,tree,sunuke);



	int nfenech = 0;

	int nsunuke = 0;



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

		if(fenech[i] <= sunuke[i]){

			nfenech++;

		}else{

			nsunuke++;

		}

	}



	if(nfenech > nsunuke) cout << "Fennec" <<endl;

	else cout << "Snuke" <<endl;

	

	return 0;

}






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

using namespace std;

vector<int>v[200000];

int t[200000];

int main()

{

	int n;

	cin>>n;

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

	{

		int x,y;

		cin>>x>>y;

		v[x].push_back(y);

		v[y].push_back(x);

	}

	queue<int>q;

	q.push(1);

	q.push(n);

	t[1]=1;

	t[n]=2;

    int f=0,s=0;

	while(!q.empty())

	{

		int a=q.front();

		q.pop();

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

		{

			int b=v[a][i];

			if(t[b]==0)

			{

				q.push(b);

				t[b]=t[a];

				if(t[b]==1)

					f++;

				else

					s++;

			}

		}

	}

	if(f>s)

		cout<<"Fennec";

	else

		cout<<"Snuke";



	return 0;

}

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

using namespace std;

vector<int>v[100000];

int a[2][100000];

int t;

void dfs(int k1,int k2=-1)

{

	if(k2!=-1)

		a[t][k1]=a[t][k2]+1;

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

	{

		if(v[k1][i]!=k2)

			dfs(v[k1][i],k1);

	}

}

int main()

{

	int n;

	cin>>n;

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

	{

		int x,y;

		cin>>x>>y;

		x--;

		y--;

		v[x].push_back(y);

		v[y].push_back(x);

	}

	t=0;

	dfs(0);

	t=1;

	dfs(n-1);

	int sum=0;

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

	{

		if(a[0][i]<=a[1][i])

			sum++;

	}

	if(sum>=n/2+1)

		cout<<"Fennec";

	else

		cout<<"Snuke";



	return 0;

}

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

#include <map>

#include <set>

#include <deque>

#include <queue>

#include <stack>

#include <bitset>

#include <algorithm>

#include <functional>

#include <numeric>

#include <climits>

#include <utility>

#include <sstream>

#include <iostream>

#include <iomanip>

#include <cstdio>

#include <cmath>

#include <cstdlib>

#include <cctype>

#include <string>

#include <cstring>

#include <ctime>

#define NDEBUG

#include <assert.h>

using namespace std;

const int INF=INT_MAX/4;

/*

Status:Writing

Type:Problemset/HB

Problem ID:Atcoder ARC B

Author:XIZCM

*/

int n,a,b;

vector<int> nei[100005];

//int dis[100005],rdis[100005];

vector<int> bfs(int start){

	vector<int> d(n,INF);

	d[start]=0;

	queue<int> q;

	q.push(start);

	while(!q.empty()){

		int t=q.front();

		q.pop();

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

			int u=nei[t][i];

			if(d[u]>d[t]+1){

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

				q.push(u);

			}

		}

	}

	return d;

}

int main(){

	scanf("%d",&n);

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

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

		a--;

		b--;

		nei[a].push_back(b);

		nei[b].push_back(a);

	}

	vector<int> dis=bfs(0);

	vector<int> rdis=bfs(n-1);

	int s=0,f=0;

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

		if(dis[i]>rdis[i]){

			s++;

		}

		else{

			f++;

		}

	}

	puts(f>s?"Fennec":"Snuke");

	return 0;

}


// Optimized solution to the same problem (faster):
#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;

	//queue <int> qb;

	q.push(1);

	color[n] = 1;

	q.push(n);

	color[1] = 0;

	while(!q.empty()){

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

			int h = q.front();

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

			q.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] = color[h];

					q.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;

}

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

#include<cstring>

#include<algorithm>

#include<queue>

#include<vector>

#define mem(a,b) memset(a,b,sizeof(a))

using namespace std;



typedef long long ll;

const int maxn=1e5+5;



vector<int> E[maxn];

int n,col[maxn];

bool vis[maxn];

void bfs(){

	mem(col,0),mem(vis,0);

	queue<int> q;

	q.push(1);vis[1]=1;col[1]=1;

	q.push(n);vis[n]=1;col[n]=2;

	while(!q.empty()){

		int f=q.front();

		q.pop();

		for(auto i:E[f]){

			if(vis[i]) continue;

			col[i]=col[f];

			vis[i]=1;

			q.push(i);

		}

	}

	int t1=0,t2=0;

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

		if(col[i]==1) t1++;

		else if(col[i]==2) t2++;

	}

	if(t1<=t2) puts("Snuke");

	else puts("Fennec");

}

int main(){

	int u,v;

	while(~scanf("%d",&n)){

		for(int i=1;i<=n;i++) E[i].clear();

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

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

			E[u].push_back(v);

			E[v].push_back(u);

		}

		bfs();

	}

	return 0;

}


// Optimized solution to the same problem (faster):
#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;

	//queue <int> qb;

	q.push(1);

	color[n] = 1;

	q.push(n);

	color[1] = 0;

	while(!q.empty()){

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

			int h = q.front();

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

			q.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] = color[h];

					q.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;

}

// Fastest known solution for this problem: