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

using namespace std;

const int N=100005;

int d1[N],d2[N];

vector<int>e[N];

queue<int>q;

int main()

{

	int n,a,b,s1=0,s2=0;

	scanf("%d",&n);

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

	{

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

		e[a].push_back(b);

		e[b].push_back(a);

	}

	memset(d1,0x3f,sizeof(d1));

	d1[1]=0;

	q.push(1);

	while(!q.empty())

	{

		int k=q.front();

		q.pop();

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

		{

			if(d1[e[k][i]]>d1[k]+1)

			{

				d1[e[k][i]]=d1[k]+1;

				q.push(e[k][i]);

			}

		}

	}

	memset(d2,0x3f,sizeof(d2));

	d2[n]=0;

	q.push(n);

	while(!q.empty())

	{

		int k=q.front();

		q.pop();

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

		{

			if(d2[e[k][i]]>d2[k]+1)

			{

				d2[e[k][i]]=d2[k]+1;

				q.push(e[k][i]);

			}

		}

	}

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

	{

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

			s1++;

		else

			s2++;

	}

	if(s1>s2)

		puts("Fennec");

	else

		puts("Snuke");

	return 0;

}


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

#include<iomanip>

#include<cmath>

#include<string>

#include<cctype>

#include<algorithm>

#include<set>

#include<map>

#include<stack>

#include<queue>

#include<cstring>

#include<list>

//#include<windows.h>

//#include<time.h>

#define pb push_back

#define ppb pop_back

#define fi first

#define se second

#define mer make_pair

#define mme memset

#define ao(a) (a.begin(),a.end())

using namespace std;



const double pie1=3.1415926;//π1

const double pie2=3.14159265358979;//π2

const double pie3=3.14159265358979323846;//π3

const int vbi=999999999;

const int vli=-vbi;

const long long vbl=999999999999999999;

const long long vll=-vbl;



typedef long long ll;

typedef pair<int,int> pii;

typedef pair<ll,ll> pll;

typedef pair<pii,int> piii;

typedef pair<pii,pii> pi4;

typedef pair<pll,ll> plll;

typedef pair<int,pii> ipii;

typedef pair<ll,pll> lpll;

typedef pair<pll,pll> pl4;

typedef vector<int> vi;

typedef vector<ll> vl;

typedef vector<pii> vpi;

typedef vector<pll> vpl;

typedef set<int> sti;

typedef set<ll> stl;

typedef set<pii> spi;

typedef set<pll> spl;

priority_queue<int> pqi;

priority_queue<ll> pql;

queue<int> qi;

queue<ll> ql;



/*void bin_v(){

	char bin[1000];

	gets(bin);

}*/



bool pss(int a){

	for(int i=2;i<=sqrt(a);i++)

		if(a%i==0)

			return false;

	return true;

}

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



int n,m;

vector<int> v[100010];

vector<int> lj;

int sss[100010];

int fi;



bool dfs(int now,int last){

	lj.pb(now);

	sss[now]=1;

	if(now==n){

		fi=lj[(lj.size()+1)/2];

	}

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

		if(v[now][i]!=last){

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

			sss[now]+=sss[v[now][i]];

		}

	lj.ppb();

	return false;

}



int main(){

	//my name is Veex_WCY

	ios::sync_with_stdio(false);

	cin>>n;

	m=n-1;

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

		int a,b;

		cin>>a>>b;

		v[a].pb(b);

		v[b].pb(a);

	}

	dfs(1,-1);

	if(sss[fi]*2<n)

		cout<<"Fennec";

	else

		cout<<"Snuke";

	return 0;

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

using namespace std;

const int N=100005;

int d1[N],d2[N];

vector<int>e[N];

queue<int>q;

int main()

{

	int n,a,b,s1=0,s2=0;

	scanf("%d",&n);

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

	{

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

		e[a].push_back(b);

		e[b].push_back(a);

	}

	memset(d1,0x3f,sizeof(d1));

	d1[1]=0;

	q.push(1);

	while(!q.empty())

	{

		int k=q.front();

		q.pop();

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

		{

			if(d1[e[k][i]]>d1[k]+1)

			{

				d1[e[k][i]]=d1[k]+1;

				q.push(e[k][i]);

			}

		}

	}

	memset(d2,0x3f,sizeof(d2));

	d2[n]=0;

	q.push(n);

	while(!q.empty())

	{

		int k=q.front();

		q.pop();

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

		{

			if(d2[e[k][i]]>d2[k]+1)

			{

				d2[e[k][i]]=d2[k]+1;

				q.push(e[k][i]);

			}

		}

	}

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

	{

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

			s1++;

		else

			s2++;

	}

	if(s1>s2)

		puts("Fennec");

	else

		puts("Snuke");

	return 0;

}


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

using namespace std;

int color[100050],fath[100050],n,ans[2];

vector <int> V[100050];

void build(int now,int f)

{

	fath[now]=f;

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

		if(V[now][i]!=f)build(V[now][i],now);

	return;

}

void dfs(bool flag,int now)

{

	color[now]=flag;

	ans[flag]++;

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

		if(color[V[now][i]]==-1)dfs(flag,V[now][i]);

}

int main()

{

	cin>>n;

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

	{

		int x,y;

		cin>>x>>y;

		V[x].push_back(y);

		V[y].push_back(x);

	}

	build(1,1);

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

	int z=n,sum=0;

	while(z!=fath[z])

	{

		sum++;

		z=fath[z];

	}

	z=n;

	for(int i=1;i<=(sum-1)/2;i++)z=fath[z];

	color[z]=1;

	color[fath[z]]=0;

	dfs(1,z);

	dfs(0,fath[z]);

	if(ans[0]>ans[1])cout<<"Fennec";

	else cout<<"Snuke";

	return 0;

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

using namespace std;

const int N=100005;

int d1[N],d2[N];

vector<int>e[N];

queue<int>q;

int main()

{

	int n,a,b,s1=0,s2=0;

	scanf("%d",&n);

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

	{

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

		e[a].push_back(b);

		e[b].push_back(a);

	}

	memset(d1,0x3f,sizeof(d1));

	d1[1]=0;

	q.push(1);

	while(!q.empty())

	{

		int k=q.front();

		q.pop();

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

		{

			if(d1[e[k][i]]>d1[k]+1)

			{

				d1[e[k][i]]=d1[k]+1;

				q.push(e[k][i]);

			}

		}

	}

	memset(d2,0x3f,sizeof(d2));

	d2[n]=0;

	q.push(n);

	while(!q.empty())

	{

		int k=q.front();

		q.pop();

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

		{

			if(d2[e[k][i]]>d2[k]+1)

			{

				d2[e[k][i]]=d2[k]+1;

				q.push(e[k][i]);

			}

		}

	}

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

	{

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

			s1++;

		else

			s2++;

	}

	if(s1>s2)

		puts("Fennec");

	else

		puts("Snuke");

	return 0;

}


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

using namespace std;

int n;

vector<int>g[100001];

int main(){

	cin>>n;

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

		int x,y;

		cin>>x>>y;

		g[x].push_back(y);

		g[y].push_back(x);

	}

	vector<int>col(n+1);

	queue<int>q;

	q.push(1);

	q.push(n);

	col[1]=1;

	col[n]=2;

	int f,s;

	f=s=1;

	while(!q.empty()){

		int x=q.front();

		q.pop();

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

			int y=g[x][i];

			if(col[y]==0){

				q.push(y);

				col[y]=col[x];

				if(col[y]==1)f++;

				else s++;

			}

		}

	}

	if(f>s)cout<<"Fennec";

	else cout<<"Snuke";

	return 0;

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

#include <vector>

using namespace std;



int n;

vector<int> pos[100010],vct;

int cnt[100010],first;



inline void dfs(int v,int pr)

{

	cnt[v]=1;

	vct.push_back(v);

	

	if(v==n-1) first=vct[(vct.size()+1)/2];

	

	for(auto to:pos[v])

	{

		if(to==pr) continue;

		dfs(to,v);

		cnt[v]+=cnt[to];

	}

	vct.pop_back();

}



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.4840528118181315x):
#define _USE_MATH_DEFINES

#include <algorithm>

#include <array>

#include <bitset>

#include <cassert>

#include <cctype>

#include <climits>

#include <clocale>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <iterator>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <regex>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <tuple>

#include <unordered_map>

#include <unordered_set>

#include <utility>

#include <vector>



const int MOD = 1000000007; 

const int INF = 1000000000; //1e9

const int NIL = -1;

const long long LINF = 1000000000000000000; // 1e18

const long double EPS = 1E-10;



template<class T, class S> inline bool chmax(T &a, const S &b){

    if(a < b){

        a = b; return true;

    }

    return false;

}

template<class T, class S> inline bool chmin(T &a, const S &b){

    if(b < a){

        a = b; return true;

    }

    return false;

}









int main(){

    int N; std::cin >> N;

    std::vector<std::vector<int>> G(N);

    std::vector<int> d0(N, -1), dN(N, -1);

    {

        int a, b;

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

            std::cin >> a >> b;

            --a; --b;

            G[a].push_back(b);

            G[b].push_back(a);

        }

    }

    d0[0] = 0;

    std::queue<int> que;

    que.push(0);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(d0[e] != -1) continue;

            d0[e] = d0[v] + 1;

            que.push(e);

        }

    }

    dN[N-1] = 0;

    que.push(N-1);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(dN[e] != -1) continue;

            dN[e] = dN[v] + 1;

            que.push(e);

        }

    }

    int cnt(0);

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

        if(d0[i] <= dN[i]) ++cnt; 

    }

    std::cout << ((2*cnt > N) ? "Fennec": "Snuke") << std::endl;

    return 0;

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

using namespace std;

const int inf=1<<30;

int cnt[100010],middle=0;

vector<int> g[100010];

vector<int> nums;

int n;

void dfs(int now,int par){

	//cout<<now<<" "<<par<<endl;

	cnt[now]=1;

	nums.push_back(now);

	if(now==n){

		middle=nums[(nums.size()+1)/2];

	}

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

		if(g[now][i]==par)continue;

		dfs(g[now][i],now);

		cnt[now]+=cnt[g[now][i]];

	}

	nums.pop_back();

	return;

}

int main(){

	cin>>n;

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

		int a,b;

		cin>>a>>b;

		g[a].push_back(b);

		g[b].push_back(a); 

	}

	dfs(1,0);

	//cout<<cnt[middle]<<endl;

	string ans=(cnt[middle]*2<n)?"Fennec":"Snuke";

	cout<<ans<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 3.4955451280465346x):
#define _USE_MATH_DEFINES

#include <algorithm>

#include <array>

#include <bitset>

#include <cassert>

#include <cctype>

#include <climits>

#include <clocale>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <iterator>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <regex>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <tuple>

#include <unordered_map>

#include <unordered_set>

#include <utility>

#include <vector>



const int MOD = 1000000007; 

const int INF = 1000000000; //1e9

const int NIL = -1;

const long long LINF = 1000000000000000000; // 1e18

const long double EPS = 1E-10;



template<class T, class S> inline bool chmax(T &a, const S &b){

    if(a < b){

        a = b; return true;

    }

    return false;

}

template<class T, class S> inline bool chmin(T &a, const S &b){

    if(b < a){

        a = b; return true;

    }

    return false;

}









int main(){

    int N; std::cin >> N;

    std::vector<std::vector<int>> G(N);

    std::vector<int> d0(N, -1), dN(N, -1);

    {

        int a, b;

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

            std::cin >> a >> b;

            --a; --b;

            G[a].push_back(b);

            G[b].push_back(a);

        }

    }

    d0[0] = 0;

    std::queue<int> que;

    que.push(0);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(d0[e] != -1) continue;

            d0[e] = d0[v] + 1;

            que.push(e);

        }

    }

    dN[N-1] = 0;

    que.push(N-1);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(dN[e] != -1) continue;

            dN[e] = dN[v] + 1;

            que.push(e);

        }

    }

    int cnt(0);

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

        if(d0[i] <= dN[i]) ++cnt; 

    }

    std::cout << ((2*cnt > N) ? "Fennec": "Snuke") << std::endl;

    return 0;

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

#define LL long long

#define mp make_pair

#define pb push_back

#define INF (1<<29)

using namespace std;

typedef pair<int,int>pii;

int n;

vector<int>G[100010];

int df[100010],ds[100010];

void bfs(int fx,int dist[100010]){

	queue<int>qq;

	qq.push(fx);

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

	dist[fx]=0;

	while(!qq.empty()){

		int node=qq.front();

		qq.pop();

		for(auto i:G[node]){

			if(dist[i]!=-1)continue;

			dist[i]=dist[node]+1;

			qq.push(i);

		}

	}

}

int main(){

	cin>>n;

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

		int x,y;

		cin>>x>>y;

		G[x].pb(y);

		G[y].pb(x);

	}

	bfs(1,df);

	bfs(n,ds);

	int f=0,s=0;

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

		if(df[i]<=ds[i])f++;

		else s++;

	}

	if(f>s)cout<<"Fennec\n";

	else cout<<"Snuke\n";

//	cout<<f<<' '<<s<<endl;

//	for(int i=1;i<=n;i++)cout<<df[i]<<' ';

//	puts("");

//	for(int i=1;i<=n;i++)cout<<ds[i]<<' ';

//	puts("");

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 3.4924141856931166x):
#define _USE_MATH_DEFINES

#include <algorithm>

#include <array>

#include <bitset>

#include <cassert>

#include <cctype>

#include <climits>

#include <clocale>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <iterator>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <regex>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <tuple>

#include <unordered_map>

#include <unordered_set>

#include <utility>

#include <vector>



const int MOD = 1000000007; 

const int INF = 1000000000; //1e9

const int NIL = -1;

const long long LINF = 1000000000000000000; // 1e18

const long double EPS = 1E-10;



template<class T, class S> inline bool chmax(T &a, const S &b){

    if(a < b){

        a = b; return true;

    }

    return false;

}

template<class T, class S> inline bool chmin(T &a, const S &b){

    if(b < a){

        a = b; return true;

    }

    return false;

}









int main(){

    int N; std::cin >> N;

    std::vector<std::vector<int>> G(N);

    std::vector<int> d0(N, -1), dN(N, -1);

    {

        int a, b;

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

            std::cin >> a >> b;

            --a; --b;

            G[a].push_back(b);

            G[b].push_back(a);

        }

    }

    d0[0] = 0;

    std::queue<int> que;

    que.push(0);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(d0[e] != -1) continue;

            d0[e] = d0[v] + 1;

            que.push(e);

        }

    }

    dN[N-1] = 0;

    que.push(N-1);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(dN[e] != -1) continue;

            dN[e] = dN[v] + 1;

            que.push(e);

        }

    }

    int cnt(0);

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

        if(d0[i] <= dN[i]) ++cnt; 

    }

    std::cout << ((2*cnt > N) ? "Fennec": "Snuke") << std::endl;

    return 0;

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

using namespace std;

const int N=100005;

int d1[N],d2[N];

vector<int>e[N];

queue<int>q;

int main()

{

	int n,a,b,s1=0,s2=0;

	scanf("%d",&n);

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

	{

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

		e[a].push_back(b);

		e[b].push_back(a);

	}

	memset(d1,0x3f,sizeof(d1));

	d1[1]=0;

	q.push(1);

	while(!q.empty())

	{

		int k=q.front();

		q.pop();

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

		{

			if(d1[e[k][i]]>d1[k]+1)

			{

				d1[e[k][i]]=d1[k]+1;

				q.push(e[k][i]);

			}

		}

	}

	memset(d2,0x3f,sizeof(d2));

	d2[n]=0;

	q.push(n);

	while(!q.empty())

	{

		int k=q.front();

		q.pop();

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

		{

			if(d2[e[k][i]]>d2[k]+1)

			{

				d2[e[k][i]]=d2[k]+1;

				q.push(e[k][i]);

			}

		}

	}

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

	{

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

			s1++;

		else

			s2++;

	}

	if(s1>s2)

		puts("Fennec");

	else

		puts("Snuke");

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 4.304340336707956x):
#define _USE_MATH_DEFINES

#include <algorithm>

#include <array>

#include <bitset>

#include <cassert>

#include <cctype>

#include <climits>

#include <clocale>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <iterator>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <regex>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <tuple>

#include <unordered_map>

#include <unordered_set>

#include <utility>

#include <vector>



const int MOD = 1000000007; 

const int INF = 1000000000; //1e9

const int NIL = -1;

const long long LINF = 1000000000000000000; // 1e18

const long double EPS = 1E-10;



template<class T, class S> inline bool chmax(T &a, const S &b){

    if(a < b){

        a = b; return true;

    }

    return false;

}

template<class T, class S> inline bool chmin(T &a, const S &b){

    if(b < a){

        a = b; return true;

    }

    return false;

}









int main(){

    int N; std::cin >> N;

    std::vector<std::vector<int>> G(N);

    std::vector<int> d0(N, -1), dN(N, -1);

    {

        int a, b;

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

            std::cin >> a >> b;

            --a; --b;

            G[a].push_back(b);

            G[b].push_back(a);

        }

    }

    d0[0] = 0;

    std::queue<int> que;

    que.push(0);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(d0[e] != -1) continue;

            d0[e] = d0[v] + 1;

            que.push(e);

        }

    }

    dN[N-1] = 0;

    que.push(N-1);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(dN[e] != -1) continue;

            dN[e] = dN[v] + 1;

            que.push(e);

        }

    }

    int cnt(0);

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

        if(d0[i] <= dN[i]) ++cnt; 

    }

    std::cout << ((2*cnt > N) ? "Fennec": "Snuke") << std::endl;

    return 0;

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

using namespace std;

#define ll long long

const int maxx = 1e5+10;

vector<int> v[maxx];

int cnt = 0;

int a[maxx],b[maxx];

void dfs(int x,int y)

{

    if(a[x])

        return ;

    a[x]=y;

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

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

}

void dfs2(int x,int y)

{

    if(b[x])

        return ;

    b[x]=y;

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

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

}

int main()

{

    int n,x,y;

    scanf("%d",&n);

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

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

        v[x].push_back(y),v[y].push_back(x);

    }

    dfs(1,1);

    dfs2(n,1);

    int cnt1 = 0,cnt2 = 0;

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

        if(a[i] <= b[i])

            cnt1++;

        else

            cnt2++;

    }

    //cout<<cnt1<<" "<<cnt2<<endl;

    if(cnt1 - cnt2 > 0)

        cout<<"Fennec\n";

    else

        cout<<"Snuke\n";

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 3.476529639696353x):
#define _USE_MATH_DEFINES

#include <algorithm>

#include <array>

#include <bitset>

#include <cassert>

#include <cctype>

#include <climits>

#include <clocale>

#include <cmath>

#include <complex>

#include <cstdio>

#include <cstdlib>

#include <ctime>

#include <deque>

#include <fstream>

#include <functional>

#include <iomanip>

#include <iostream>

#include <iterator>

#include <list>

#include <map>

#include <numeric>

#include <queue>

#include <regex>

#include <set>

#include <sstream>

#include <stack>

#include <string>

#include <tuple>

#include <unordered_map>

#include <unordered_set>

#include <utility>

#include <vector>



const int MOD = 1000000007; 

const int INF = 1000000000; //1e9

const int NIL = -1;

const long long LINF = 1000000000000000000; // 1e18

const long double EPS = 1E-10;



template<class T, class S> inline bool chmax(T &a, const S &b){

    if(a < b){

        a = b; return true;

    }

    return false;

}

template<class T, class S> inline bool chmin(T &a, const S &b){

    if(b < a){

        a = b; return true;

    }

    return false;

}









int main(){

    int N; std::cin >> N;

    std::vector<std::vector<int>> G(N);

    std::vector<int> d0(N, -1), dN(N, -1);

    {

        int a, b;

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

            std::cin >> a >> b;

            --a; --b;

            G[a].push_back(b);

            G[b].push_back(a);

        }

    }

    d0[0] = 0;

    std::queue<int> que;

    que.push(0);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(d0[e] != -1) continue;

            d0[e] = d0[v] + 1;

            que.push(e);

        }

    }

    dN[N-1] = 0;

    que.push(N-1);

    while(!que.empty()){

        int v(que.front()); que.pop();

        for(int e: G[v]){

            if(dN[e] != -1) continue;

            dN[e] = dN[v] + 1;

            que.push(e);

        }

    }

    int cnt(0);

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

        if(d0[i] <= dN[i]) ++cnt; 

    }

    std::cout << ((2*cnt > N) ? "Fennec": "Snuke") << std::endl;

    return 0;

}