stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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;

}

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

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;

}


// Faster C++ solution for the same problem (measured speedup: 3.4837755264207084x):
#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: 1.227249737846073x):
// In the name of God



#include <bits/stdc++.h>



using namespace std;



const int N = 1e5+5;



int timer;

int level[N], par[N][22], tin[N], tout[N];

vector<int> adj[N];



void dfs(int u, int p) {

	tin[u] = ++timer;

	level[u] = level[p] + 1;

	par[u][0] = p;

	for(int v : adj[u]) {

		if(v == p) continue;

		dfs(v, u);

	}

	tout[u] = ++timer;

}



bool is_ancestor(int u, int v) {

	return tin[u] <= tin[v] && tout[u] >= tout[v];

}



int main() {

	ios_base::sync_with_stdio(false);

	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].push_back(v);

		adj[v].push_back(u);

	}

	dfs(0, 0);

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

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

			par[j][i] = par[par[j][i-1]][i-1];

		}

	}



	auto lca = [&](int u, int v) {

		if(is_ancestor(u, v)) return u;

		if(is_ancestor(v, u)) return v;

		for(int i = 21; i >= 0; i--) {

			if(!is_ancestor(par[u][i], v)) {

				u = par[u][i];

			}

		}

		return par[u][0];

	};



	int c1 = 0, c2 = 0;



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

		int d1 = level[i] + level[0] - 2 * level[lca(i, 0)];

		int d2 = level[i] + level[n - 1] - 2 * level[lca(i, n - 1)];

		if(d1 <= d2) c1++;

		else c2++;

	}

	if(c1 > c2) cout << "Fennec";

	else cout << "Snuke";

	return 0;

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

#include <algorithm>

#include <math.h>

#include <string>

#include <cstdio>

#include <vector>

#include <set>

#include <cassert>

#include <cstdlib>

#include <complex>

#include <cctype>

#include <cmath>

#include <ctime>

#include <deque>

#include <queue>

#include <stack>

#include <map>

#include <set>

#include <sstream>

#include <functional>

//#include <windows.h>  //Should be deleted when using AtCoder&POJ

using namespace std;

/**==Info==

*Program:2

*Problem:Fennce VS Snuke

*Date:2017-8-12

*Algorithm:DFS

*Stats:WA for 7 tests(But faster) :)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))*/

int n;

vector<int> nei[100005];

int d[2][100005];

inline void dfs(int root,int dis,int place){ //root:this point,dis:now distance,place:which place to write in Array

	d[place][root]=dis;

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

		if(d[place][nei[root][i]]>d[place][root]+1){

			d[place][nei[root][i]]=d[place][root]+1;

			dfs(nei[root][i],dis+1,place);

		}

	}

}

int main(){

	scanf("%d",&n);

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

		int a,b;

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

		a--;b--;

		nei[a].push_back(b);

		nei[b].push_back(a);

	}

	for(int i=0;i<n;i++) d[0][i]=d[1][i]=1e8;

	dfs(0,0,0);

	dfs(n-1,0,1);

	

	int f=0,s=0;

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

		//cout<<d[0][i]<<" "<<d[1][i]<<endl;

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

			f++;

		}else{

			s++;

		}

	}

	cout<<(f>s?"Fennec":"Snuke");

	return 0;

}


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

#include <vector>

#include <queue>

using namespace std;



inline vector<int> bfs(int n,vector<vector<int> > &g,int s)

{

	vector<int> d(n,1e9);d[s]=0;

	queue<int>q;q.push(s);

	while(!q.empty())

	{

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

		for(auto v:g[cur])

			if(d[v]>d[cur]+1)

			{

				d[v]=d[cur]+1;

				q.push(v);

			}

	}

	return d;

}



int main()

{

	int n;

	cin>>n;

	vector<vector<int> > g(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);

	}

	

	vector<int> a=bfs(n,g,0);

	vector<int> b=bfs(n,g,n-1);

	

	int f=0,s=0;

	for(int i=0;i<n;i++) if(a[i]<=b[i]) f++; else s++;

	cout<<(f>s?"Fennec":"Snuke");

	

	return 0;

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

#include <vector>

#include <cstring>

using namespace std;



int n;

vector<int> pos[100010];

int cnt[100010],l[100010],p[100010];



inline void dfs(int v)

{

	cnt[v]=1;

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

	{

		int cur=pos[v][i];

		if(p[v]==cur) continue;

		l[cur]=l[v]+1;p[cur]=v;

		dfs(cur);

		cnt[v]+=cnt[cur];

	}

}



int main()

{

	cin>>n;

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

	{

		int a,b;

		cin>>a>>b;

		pos[a].push_back(b);

		pos[b].push_back(a);

	}

	

	dfs(1);

	int sz=(l[n]-1)/2,v=n;

	while(sz--) v=p[v];

	if(cnt[v]>=n-cnt[v]) cout<<"Snuke"; else cout<<"Fennec";

	

	return 0;

}

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

#include <vector>

#include <queue>

using namespace std;



inline vector<int> bfs(int n,vector<vector<int> > &g,int s)

{

	vector<int> d(n,1e9);d[s]=0;

	queue<int>q;q.push(s);

	while(!q.empty())

	{

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

		for(auto v:g[cur])

			if(d[v]>d[cur]+1)

			{

				d[v]=d[cur]+1;

				q.push(v);

			}

	}

	return d;

}



int main()

{

	int n;

	cin>>n;

	vector<vector<int> > g(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);

	}

	

	vector<int> a=bfs(n,g,0);

	vector<int> b=bfs(n,g,n-1);

	

	int f=0,s=0;

	for(int i=0;i<n;i++) if(a[i]<=b[i]) f++; else s++;

	cout<<(f>s?"Fennec":"Snuke");

	

	return 0;

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

#include <algorithm>

#include <math.h>

#include <string>

#include <cstdio>

#include <vector>

#include <set>

#include <cassert>

#include <cstdlib>

#include <complex>

#include <cctype>

#include <cmath>

#include <ctime>

#include <deque>

#include <queue>

#include <stack>

#include <map>

#include <set>

#include <sstream>

#include <functional>

//#include <windows.h>  //Should be deleted when using AtCoder&POJ

using namespace std;

/**==Info==

*Program:2

*Problem:Fennce VS Snuke

*Date:2017-8-12

*Algorithm:DFS

*Stats:WA for 7 tests(But faster) :)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))*/

int n;

vector<int> nei[100005];

int d[2][100005];

inline void dfs(int root,int dis,int place){ //root:this point,dis:now distance,place:which place to write in Array

	d[place][root]=dis;

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

		if(d[place][nei[root][i]]>d[place][root]+1){

			d[place][nei[root][i]]=d[place][root]+1;

			dfs(nei[root][i],dis+1,place);

		}

	}

}

int main(){

	scanf("%d",&n);

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

		int a,b;

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

		a--;b--;

		nei[a].push_back(b);

		nei[b].push_back(a);

	}

	for(int i=0;i<n;i++) d[0][i]=d[1][i]=1e8;

	dfs(0,0,0);

	dfs(n-1,0,1);

	

	int f=0,s=0;

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

		//cout<<d[0][i]<<" "<<d[1][i]<<endl;

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

			f++;

		}else{

			s++;

		}

	}

	cout<<(f>s?"Fennec":"Snuke");

	return 0;

}


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

#include<cstdio>

using namespace std;

int n,a,b,cnt=0,id=0,ne[100005],in[100005],out[100005],cnt1,cnt2,fa[100005][20],len[100005];

struct node{

    int v,next;

}edge[400005];

inline int read(){

	char c=getchar();

	int x=0;

	for(;c>'9'||c<'0';) c=getchar();

	for(;c>='0'&&c<='9';){

		x=(x<<3)+(x<<1)+c-'0';

		c=getchar();

	}

	return x;

}

inline void add(int u,int v){

    edge[cnt]={v,ne[u]};

    ne[u]=cnt++;

    edge[cnt]={u,ne[v]};

    ne[v]=cnt++;

}

inline void dfs(int cur,int pre,int d){

    fa[cur][0]=pre;

    len[cur]=d;

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

        fa[cur][i]=fa[fa[cur][i-1]][i-1];

    in[cur]=++id;

    for(int i=ne[cur];i!=-1;i=edge[i].next){

        int v=edge[i].v;

        if(v==pre) continue;

        dfs(v,cur,d+1);

    }

    out[cur]=id;

}

int main(){

	n=read();

    for(int i=0;i<100005;i++) ne[i]=-1;

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

    	a=read(),b=read();

        add(a,b);

    }

    dfs(1,0,0);

    int tmp=(len[n]-1)>>1,now=n;

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

        if(tmp>>i&1) now=fa[now][i];

    cnt1=n-(out[now]-in[now]+1)-len[n]/2-1,cnt2=out[now]-in[now]+1-tmp-1;

    if(len[n]&1){

        if(cnt1<=cnt2) puts("Snuke");

        else puts("Fennec");

        return 0;

    }

    if(cnt2>cnt1) puts("Snuke");

    else puts("Fennec");

    return 0;

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

#include <vector>

#include <cstring>

using namespace std;



int n;

vector<int> pos[100010];

int cnt[100010],l[100010],p[100010];



inline void dfs(int v)

{

	cnt[v]=1;

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

	{

		int cur=pos[v][i];

		if(p[v]==cur) continue;

		l[cur]=l[v]+1;p[cur]=v;

		dfs(cur);

		cnt[v]+=cnt[cur];

	}

}



int main()

{

	cin>>n;

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

	{

		int a,b;

		cin>>a>>b;

		pos[a].push_back(b);

		pos[b].push_back(a);

	}

	

	dfs(1);

	int sz=(l[n]-1)/2,v=n;

	while(sz--) v=p[v];

	if(cnt[v]>=n-cnt[v]) cout<<"Snuke"; else cout<<"Fennec";

	

	return 0;

}

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

#include<cstdio>

using namespace std;

int n,a,b,cnt=0,id=0,ne[100005],in[100005],out[100005],cnt1,cnt2,fa[100005][20],len[100005];

struct node{

    int v,next;

}edge[400005];

inline int read(){

	char c=getchar();

	int x=0;

	for(;c>'9'||c<'0';) c=getchar();

	for(;c>='0'&&c<='9';){

		x=(x<<3)+(x<<1)+c-'0';

		c=getchar();

	}

	return x;

}

inline void add(int u,int v){

    edge[cnt]={v,ne[u]};

    ne[u]=cnt++;

    edge[cnt]={u,ne[v]};

    ne[v]=cnt++;

}

inline void dfs(int cur,int pre,int d){

    fa[cur][0]=pre;

    len[cur]=d;

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

        fa[cur][i]=fa[fa[cur][i-1]][i-1];

    in[cur]=++id;

    for(int i=ne[cur];i!=-1;i=edge[i].next){

        int v=edge[i].v;

        if(v==pre) continue;

        dfs(v,cur,d+1);

    }

    out[cur]=id;

}

int main(){

	n=read();

    for(int i=0;i<100005;i++) ne[i]=-1;

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

    	a=read(),b=read();

        add(a,b);

    }

    dfs(1,0,0);

    int tmp=(len[n]-1)>>1,now=n;

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

        if(tmp>>i&1) now=fa[now][i];

    cnt1=n-(out[now]-in[now]+1)-len[n]/2-1,cnt2=out[now]-in[now]+1-tmp-1;

    if(len[n]&1){

        if(cnt1<=cnt2) puts("Snuke");

        else puts("Fennec");

        return 0;

    }

    if(cnt2>cnt1) puts("Snuke");

    else puts("Fennec");

    return 0;

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

namespace chtholly{

typedef long long ll;

#define re0 register int

#define rec register char

#define rel register ll

#define gc getchar

#define pc putchar

#define p32 pc(' ')

#define pl puts("")

/*By Citrus*/

inline int read(){

  int x=0,f=1;char c=gc();

  for (;!isdigit(c);c=gc()) f^=c=='-';

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return f?x:-x;

  }

template <typename mitsuha>

inline bool read(mitsuha &x){

  x=0;int f=1;char c=gc();

  for (;!isdigit(c)&&~c;c=gc()) f^=c=='-';

  if (!~c) return 0;

  for (;isdigit(c);c=gc()) x=(x<<3)+(x<<1)+(c^'0');

  return x=f?x:-x,1;

  }

template <typename mitsuha>

inline int write(mitsuha x){

  if (!x) return pc(48);

  if (x<0) x=-x,pc('-');

  int bit[20],i,p=0;

  for (;x;x/=10) bit[++p]=x%10;

  for (i=p;i;--i) pc(bit[i]+48);

  return 0;

  }

inline char fuhao(){

  char c=gc();

  for (;isspace(c);c=gc());

  return c;

  }

}using namespace chtholly;

using namespace std;

const int yuzu=1e5;

vector<int> lj[yuzu|10];

typedef int fuko[yuzu|10];

fuko d1,d2;

int n=read();



void dfs(int u,int fa,int *d){

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

for (int i:lj[u]) if (i^fa) dfs(i,u,d);

}



int main(){

int i,u,v;

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

  u=read(),v=read();

  lj[u].push_back(v);

  lj[v].push_back(u);

  }

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

int cnt=0;

for (i=1;i<=n;++i) cnt+=d1[i]<=d2[i];

puts(cnt*2<=n?"Snuke":"Fennec");

}

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

#include<cstdio>

using namespace std;

int n,a,b,cnt=0,id=0,ne[100005],in[100005],out[100005],cnt1,cnt2,fa[100005][20],len[100005];

struct node{

    int v,next;

}edge[400005];

inline int read(){

	char c=getchar();

	int x=0;

	for(;c>'9'||c<'0';) c=getchar();

	for(;c>='0'&&c<='9';){

		x=(x<<3)+(x<<1)+c-'0';

		c=getchar();

	}

	return x;

}

inline void add(int u,int v){

    edge[cnt]={v,ne[u]};

    ne[u]=cnt++;

    edge[cnt]={u,ne[v]};

    ne[v]=cnt++;

}

inline void dfs(int cur,int pre,int d){

    fa[cur][0]=pre;

    len[cur]=d;

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

        fa[cur][i]=fa[fa[cur][i-1]][i-1];

    in[cur]=++id;

    for(int i=ne[cur];i!=-1;i=edge[i].next){

        int v=edge[i].v;

        if(v==pre) continue;

        dfs(v,cur,d+1);

    }

    out[cur]=id;

}

int main(){

	n=read();

    for(int i=0;i<100005;i++) ne[i]=-1;

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

    	a=read(),b=read();

        add(a,b);

    }

    dfs(1,0,0);

    int tmp=(len[n]-1)>>1,now=n;

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

        if(tmp>>i&1) now=fa[now][i];

    cnt1=n-(out[now]-in[now]+1)-len[n]/2-1,cnt2=out[now]-in[now]+1-tmp-1;

    if(len[n]&1){

        if(cnt1<=cnt2) puts("Snuke");

        else puts("Fennec");

        return 0;

    }

    if(cnt2>cnt1) puts("Snuke");

    else puts("Fennec");

    return 0;

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

using namespace std;

vector<int> g[100010];

int clr[100010];

int main(){

	int n;

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

	}

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

	clr[1]=1;clr[n]=2;

	queue<int> q;

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

	while(!q.empty()){

		int x=q.front();

		q.pop();

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

			if(clr[g[x][i]]==-1){

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

				clr[g[x][i]]=clr[x];

			}

		}

	}

	int fennec=0,snuke=0;

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

		if(clr[i]==1)fennec++;

		else snuke++;

	}

	if(fennec>snuke)cout<<"Fennec"<<endl;

	else cout<<"Snuke"<<endl;

	return 0;

}

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

#include<cstring>

#include<string>

#include<algorithm>

#include<cstdio>

#include<vector> 

using namespace std;

#define N 100002

vector<int> g[N];

int parent[N],dis[N];

int n,num;

void dfs(int cur,int par){

	int i,now;

	dis[cur] = dis[par] + 1;

//	cout<<cur<<' '<<dis[cur]<<endl;

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

	{

		now = g[cur][i];

		if( now == par )

			continue;

		parent[now]=cur;

		dfs(now,cur);

	}

}

// 求一棵子树中的节点数量 

void dfs1(int cur,int par){

	int i,now;

	num++;

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

	{

		now = g[cur][i];

		if( now == par )

			continue;

		dfs1(now,cur);

	}

}

int main(){

	int i,to,from,k,cur,cnt;

	cin>>n;

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

		cin>>to>>from;

		g[to].push_back(from);

		g[from].push_back(to);

	}

	dis[0]=-1;

	dfs(1,0);

	k=dis[n]-1;

//	cout<<k<<endl;

	cur = n;

	cnt=0;

	while( 1 )

	{

		if( cnt>=k/2 )

			break;

		cur = parent[cur];

		cnt++;

	}

	num=0;

	dfs1(cur,parent[cur]);

//	cout<<num<<endl;

	if( num>=n-num )

		cout<<"Snuke";

	else

		cout<<"Fennec";

	return 0;

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

using namespace std;

vector<int> g[100010];

int clr[100010];

int main(){

	int n;

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

	}

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

	clr[1]=1;clr[n]=2;

	queue<int> q;

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

	while(!q.empty()){

		int x=q.front();

		q.pop();

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

			if(clr[g[x][i]]==-1){

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

				clr[g[x][i]]=clr[x];

			}

		}

	}

	int fennec=0,snuke=0;

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

		if(clr[i]==1)fennec++;

		else snuke++;

	}

	if(fennec>snuke)cout<<"Fennec"<<endl;

	else cout<<"Snuke"<<endl;

	return 0;

}

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

/******************************************/

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

#define mp make_pair

#define pb push_back

#define x first

#define y second

#define forn(i,a,n) for(int i=a;i<n;i++)

#define foreach(i,c) for(__typeof(c.begin())i=(c.begin());i!=(c).end();i++)

#define pii pair<int,int>

#define vi vector<int>

#define ll long long

#define sz(s) s.size()

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

#define zero(x) memset(x,0,sizeof(x))

#define vii vector<pair<int,int> >;

#define mpis map<int,string>

#define mpii map<int,int>

#define mpsi map<string,int>

#define re return

/******************************************/

using namespace std;

int n,a,b;

vector<int> v[100000];

int step[2][100000];

void dfs(int fx,int d,int c){

	step[c][d]=step[c][fx]+1;

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

	if(v[d][i]!=fx)

	dfs(d,v[d][i],c);

}

int main(){

	cin>>n;

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

		cin>>a>>b;

		a--,b--;

		v[a].pb(b);

		v[b].pb(a);

	}

	step[0][0]=-1;

	step[1][n-1]=-1;

	dfs(0,0,0);

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

	int black=0,white=0;

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

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

		black++;

		else

		white++;

	}

	if(black>white)

	cout<<"Fennec";

	else

	cout<<"Snuke";

	re 0;

}