stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
/////////////////////////////////////////

////////// ^\/^ *_* :) :-D '~' \\\\\\\\\\

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

#include <bits/stdc++.h>

//#include <algorithm>

//#include <cstdio>

//#include <functional>

#include <iostream>

//#include <cfloat>

//#include <climits>

//#include <cstdlib>

//#include <cstring>

//#include <cmath>

//#include <map>

//#include <queue>

//#include <set>

//#include <sstream>

//#include <stack>

//#include <string>

//#include <time.h>

//#include <vector>

//#include <random>

//#include <unordered_set>

//#include <complex>

//#include <string.h>



#define rt0 return 0

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

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

#define LL long long

#define pii pair<int,int>

#define pb push_back

#define fi first

#define se second

#define mpr make_pair



using namespace std;



const LL MOD=1e9+7;

int n,dist[100010],dist2[100010];

vector <int> g[100010];



int main()

{

	cin>>n;

	rep(i,n-1)

	{

		int x,y;

		cin>>x>>y;

		g[x].pb(y);

		g[y].pb(x);

	}

	memset(dist,1,sizeof(dist));

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

	queue <int> q;

	dist[1]=0;

	q.push(1);

	while(!q.empty())

	{

		int t=q.front();

		q.pop();

		rep(i,g[t].size())

		{

			if(dist[g[t][i]]!=16843009) continue;

			else

			{

				dist[g[t][i]]=dist[t]+1;

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

			}

		}

	}

	queue <int> q1;

	dist2[n]=0;

	q1.push(n);

	while(!q1.empty())

	{

		int t=q1.front();

		q1.pop();

		rep(i,g[t].size())

		{

			if(dist2[g[t][i]]!=16843009) continue;

			else

			{

				dist2[g[t][i]]=dist2[t]+1;

				q1.push(g[t][i]);

			}

		}

	}

	int fen=0,snu=0;

	repn(i,n)

	{

		if(dist[i]<=dist2[i]) fen++;

		else snu++;

	}

	if(fen>snu) puts("Fennec");

	else puts("Snuke");

	rt0;

}

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

#include<vector>

#include<algorithm>

using namespace std;

typedef unsigned uint;

int inline in(){int x=0,c;for(;(uint)((c=getchar())-'0')>=10;)

{if(c=='-')return -in();if(!~c)throw ~0;}do{x=(x<<3)+(x<<1)+(c-'0');}

while((uint)((c=getchar())-'0')<10);return x;}

int n;

void dfs(int u,vector<vector<int> >&E,vector<int>&p,vector<int>&sz){

	sz[u]=1;

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

		int to=E[u][i];

		if(p[u]!=to){

			p[to]=u;

			dfs(to,E,p,sz);

			sz[u]+=sz[to];

		}

	}

}

int main(){

    n=in();

	vector<vector<int> >E(n);

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

		int a,b;

		a=in();b=in();

		a--;b--;

		E[a].push_back(b);

		E[b].push_back(a);

	}

	vector<int> p(n,-1),sz(n,0);

	dfs(0,E,p,sz);

	vector<int>path;

	int c=n-1,psz=0;

	while(c>=0){

		path.push_back(sz[c]-psz);

		psz=sz[c];

		c=p[c];

	}

	reverse(path.begin(),path.end());

	int ls=0;

	for(int i=0;i<((int)path.size()+1)/2;i++){

		ls+=path[i];

	}

	if(2*ls>n)printf("Fennec");

	else printf("Snuke");

	return 0;

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

using namespace std;

#define SZ(v) ((int)(v).size())

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

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

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

typedef long long ll;

typedef unsigned uint;

const int INF=0x3f3f3f3f;

int inline in(){int x=0,c;for(;(uint)((c=getchar())-'0')>=10;)

{if(c=='-')return -in();if(!~c)throw ~0;}do{x=(x<<3)+(x<<1)+(c-'0');}

while((uint)((c=getchar())-'0')<10);return x;}

int n;

vector<int>G[100005];

int dist1[100005],dist2[100005];

void dfs1(int v,int p,int t){

	dist1[v]=t;

	rep(i,SZ(G[v])){

		int to=G[v][i];

		if(to!=p){

			dfs1(to,v,t+1);

		}

	}

}

void dfs2(int v,int p,int t){

	dist2[v]=t;

	rep(i,SZ(G[v])){

		int to=G[v][i];

		if(to!=p){

			dfs2(to,v,t+1);

		}

	}

}

int main(){

    cin.sync_with_stdio(false);cin.tie(0);

	cin>>n;

	rep(i,n-1){

		int u,v;

		cin>>u>>v;

		G[u].push_back(v);

		G[v].push_back(u);

	}

	dfs1(1,-1,0);

	dfs2(n,-1,0);

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

//		cout<<dist1[i]<<' ';

//	}

//	cout<<endl;

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

//		cout<<dist2[i]<<' ';

//	}

//	cout<<endl;

	int cnt1=0,cnt2=0;

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

		if(dist1[i]<=dist2[i])cnt1++;

		else cnt2++;

	}

	if(cnt1>cnt2)cout<<"Fennec"<<endl;

	else cout<<"Snuke"<<endl;

	return 0;

}

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

#include<vector>

#include<algorithm>

using namespace std;

typedef unsigned uint;

int inline in(){int x=0,c;for(;(uint)((c=getchar())-'0')>=10;)

{if(c=='-')return -in();if(!~c)throw ~0;}do{x=(x<<3)+(x<<1)+(c-'0');}

while((uint)((c=getchar())-'0')<10);return x;}

int n;

void dfs(int u,vector<vector<int> >&E,vector<int>&p,vector<int>&sz){

	sz[u]=1;

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

		int to=E[u][i];

		if(p[u]!=to){

			p[to]=u;

			dfs(to,E,p,sz);

			sz[u]+=sz[to];

		}

	}

}

int main(){

    n=in();

	vector<vector<int> >E(n);

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

		int a,b;

		a=in();b=in();

		a--;b--;

		E[a].push_back(b);

		E[b].push_back(a);

	}

	vector<int> p(n,-1),sz(n,0);

	dfs(0,E,p,sz);

	vector<int>path;

	int c=n-1,psz=0;

	while(c>=0){

		path.push_back(sz[c]-psz);

		psz=sz[c];

		c=p[c];

	}

	reverse(path.begin(),path.end());

	int ls=0;

	for(int i=0;i<((int)path.size()+1)/2;i++){

		ls+=path[i];

	}

	if(2*ls>n)printf("Fennec");

	else printf("Snuke");

	return 0;

}
// Slower C++ solution:
/////////////////////////////////////////

////////// ^\/^ *_* :) :-D '~' \\\\\\\\\\

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

#include <bits/stdc++.h>

//#include <algorithm>

//#include <cstdio>

//#include <functional>

#include <iostream>

//#include <cfloat>

//#include <climits>

//#include <cstdlib>

//#include <cstring>

//#include <cmath>

//#include <map>

//#include <queue>

//#include <set>

//#include <sstream>

//#include <stack>

//#include <string>

//#include <time.h>

//#include <vector>

//#include <random>

//#include <unordered_set>

//#include <complex>

//#include <string.h>



#define rt0 return 0

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

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

#define LL long long

#define pii pair<int,int>

#define pb push_back

#define fi first

#define se second

#define mpr make_pair



using namespace std;



const LL MOD=1e9+7;

int n,dist[100010],dist2[100010];

vector <int> g[100010];



int main()

{

	cin>>n;

	rep(i,n-1)

	{

		int x,y;

		cin>>x>>y;

		g[x].pb(y);

		g[y].pb(x);

	}

	memset(dist,1,sizeof(dist));

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

	queue <int> q;

	dist[1]=0;

	q.push(1);

	while(!q.empty())

	{

		int t=q.front();

		q.pop();

		rep(i,g[t].size())

		{

			if(dist[g[t][i]]!=16843009) continue;

			else

			{

				dist[g[t][i]]=dist[t]+1;

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

			}

		}

	}

	queue <int> q1;

	dist2[n]=0;

	q1.push(n);

	while(!q1.empty())

	{

		int t=q1.front();

		q1.pop();

		rep(i,g[t].size())

		{

			if(dist2[g[t][i]]!=16843009) continue;

			else

			{

				dist2[g[t][i]]=dist2[t]+1;

				q1.push(g[t][i]);

			}

		}

	}

	int fen=0,snu=0;

	repn(i,n)

	{

		if(dist[i]<=dist2[i]) fen++;

		else snu++;

	}

	if(fen>snu) puts("Fennec");

	else puts("Snuke");

	rt0;

}

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

using namespace std;

int n;

const int MAXN=1e5+5;

vector<int>g[MAXN];

int dist[2][MAXN],id;

void dfs(int idx,int par=-1){

	if(~par)dist[id][idx]=dist[id][par]+1;

	for(auto &to:g[idx])if(to!=par)dfs(to,idx);

}

int main(){

	cin>>n;

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

		int a,b;

		cin>>a>>b;

		a--;b--;

		g[a].emplace_back(b);

		g[b].emplace_back(a);

	}

	id=0;

	dfs(0);

	id=1;

	dfs(n-1);

	int ret=0;

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

		if(dist[0][i]<=dist[1][i])ret++;

	}

	if(2*ret>n)cout<<"Fennec";

	else cout<<"Snuke";

	return 0;

}
// Slower C++ solution:
/////////////////////////////////////////

////////// ^\/^ *_* :) :-D '~' \\\\\\\\\\

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

#include <bits/stdc++.h>

//#include <algorithm>

//#include <cstdio>

//#include <functional>

#include <iostream>

//#include <cfloat>

//#include <climits>

//#include <cstdlib>

//#include <cstring>

//#include <cmath>

//#include <map>

//#include <queue>

//#include <set>

//#include <sstream>

//#include <stack>

//#include <string>

//#include <time.h>

//#include <vector>

//#include <random>

//#include <unordered_set>

//#include <complex>

//#include <string.h>



#define rt0 return 0

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

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

#define LL long long

#define pii pair<int,int>

#define pb push_back

#define fi first

#define se second

#define mpr make_pair



using namespace std;



const LL MOD=1e9+7;

int n,dist[100010],dist2[100010];

vector <int> g[100010];



int main()

{

	cin>>n;

	rep(i,n-1)

	{

		int x,y;

		cin>>x>>y;

		g[x].pb(y);

		g[y].pb(x);

	}

	memset(dist,1,sizeof(dist));

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

	queue <int> q;

	dist[1]=0;

	q.push(1);

	while(!q.empty())

	{

		int t=q.front();

		q.pop();

		rep(i,g[t].size())

		{

			if(dist[g[t][i]]!=16843009) continue;

			else

			{

				dist[g[t][i]]=dist[t]+1;

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

			}

		}

	}

	queue <int> q1;

	dist2[n]=0;

	q1.push(n);

	while(!q1.empty())

	{

		int t=q1.front();

		q1.pop();

		rep(i,g[t].size())

		{

			if(dist2[g[t][i]]!=16843009) continue;

			else

			{

				dist2[g[t][i]]=dist2[t]+1;

				q1.push(g[t][i]);

			}

		}

	}

	int fen=0,snu=0;

	repn(i,n)

	{

		if(dist[i]<=dist2[i]) fen++;

		else snu++;

	}

	if(fen>snu) puts("Fennec");

	else puts("Snuke");

	rt0;

}

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

using namespace std;



const int MAXN=100000+10;

vector<int> edge[MAXN];//用邻接表来实现树的存储

int n,cnt[3];//cnt用来记录颜色数量

int tree[MAXN];//tree数组储存每个节点的颜色，1是指black，2指white



void bfs()

{

    queue<int> q;

    q.push(1),q.push(n);//Fennec先，Snuke后，所以先后入队

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

            //cnt[tree[temp]]++;  不要在意细节（^_^）

            if(tree[v])continue;

            else tree[v]=tree[temp];//判断是否涂过色

            q.push(v);

        }

    }

}



int main()

{

    ios::sync_with_stdio(false);

    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])//因为Fennec先手，所以如果最终结果相同，很明显是Snuke赢了

        cout<<"Snuke"<<endl;

    else

        cout<<"Fennec"<<endl;

    return 0;

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

using namespace std;

int dist1[200009],dist2[200009],n,a,b;

vector<int>x[200009];

void dfs1(int pos,int depth)

{

    

    if(dist1[pos]!=-1) return;

    dist1[pos]=depth;

    for(int i=0; i<x[pos].size(); i++) dfs1(x[pos][i],depth+1);

}

void dfs2(int pos,int depth)

{

    

    if(dist2[pos]!=-1) return;

    dist2[pos]=depth;

    for(int i=0; i<x[pos].size(); i++) dfs2(x[pos][i],depth+1);

}

int main()

{

    cin>>n;

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

    {

        cin>>a>>b;

        x[a].push_back(b);

        x[b].push_back(a);

    }

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

    {

        dist1[i]=-1;

        dist2[i]=-1;

    }

    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) cout<<"Fennec"<<endl;

    else cout<<"Snuke"<<endl;

    

    return 0;

}

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

using namespace std;



const int MAXN=100000+10;

vector<int> edge[MAXN];//用邻接表来实现树的存储

int n,cnt[3];//cnt用来记录颜色数量

int tree[MAXN];//tree数组储存每个节点的颜色，1是指black，2指white



void bfs()

{

    queue<int> q;

    q.push(1),q.push(n);//Fennec先，Snuke后，所以先后入队

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

            //cnt[tree[temp]]++;  不要在意细节（^_^）

            if(tree[v])continue;

            else tree[v]=tree[temp];//判断是否涂过色

            q.push(v);

        }

    }

}



int main()

{

    ios::sync_with_stdio(false);

    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])//因为Fennec先手，所以如果最终结果相同，很明显是Snuke赢了

        cout<<"Snuke"<<endl;

    else

        cout<<"Fennec"<<endl;

    return 0;

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

#include <queue>

#include <vector>

#define SHN 1000000ll

using namespace std;

int n;

vector<int> d1(100010,SHN),d2(100010,SHN);

vector<int> edge[100010];

void bfs(vector<int> &d,int s)

{

	queue<int> q;

	q.push(s);

	d[s]=0;

	while (!q.empty())

	{

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

		int t=d[x];

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

		{

			int xi=edge[x][i];

			if (d[xi]>t+1) d[xi]=t+1,q.push(xi);

		}

	}

}

int main()

{

	cin >>n;

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

	{

		int x,y;

		cin >>x>>y;

		x--,y--;

		edge[x].push_back(y);

		edge[y].push_back(x);

	}

	bfs(d1,0);

	bfs(d2,n-1);

	int r1=0,r2=0;

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

	{

		//cout <<d1[i]<<" "<<d2[i]<<"\n";

		if (d1[i]<=d2[i]) r1++;

		else r2++;

	}

	cout <<(r1>r2 ? "Fennec" : "Snuke");

	return 0;

}

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

#include <queue>

#include <vector>

using namespace std;

int n;

vector<int> edge[100010];

queue<int> q;

int col[100010];

int main()

{

	cin >>n;

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

	{

		int x,y;

		cin >>x>>y;

		x--,y--;

		edge[x].push_back(y);

		edge[y].push_back(x);

	}

	fill(col,col+n,-1);

	col[0]=1;

	col[n-1]=0;

	q.push(0);

	q.push(n-1);

	while (!q.empty())

	{

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

		int t=col[x];

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

		{

			int xi=edge[x][i];

			if (col[xi]==-1) col[xi]=t,q.push(xi);

		}

	}

	int r1=0,r2=0;

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

	{

		if (col[i]) r1++;

		else r2++;

	}

	cout <<(r1>r2 ? "Fennec" : "Snuke");

	return 0;

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

using namespace std;



const int maxn = 200000+16;



int n;

vector<int> g[maxn];

int d1[maxn], d2[maxn];



void dfs(int p, int last, int d, int wd[]) {

   wd[p] = d;

   for (int x : g[p]) {

      if (x != last) {

         dfs(x, p, d+1, wd);

      }

   }

}



int main() {

   cin >> n;

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

      g[i].clear();

   }

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

      int x, y;

      cin >> x >> y;

      --x, --y;

      g[x].push_back(y);

      g[y].push_back(x);

   }

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

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



   int ret = 0;

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

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

         ++ret;

      } else {

         --ret;

      }

   }



   puts(ret>0?"Fennec":"Snuke");



   return 0;

}

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

using namespace std;



#define ll long long

#define vvi vector<vector<int>>

#define vec vector

#define pq priority_queue

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

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

#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))

#define debug(x) cerr << #x << ": " << x << endl;

#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;

#define debug3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;

#define debugB(x, y) cerr<<#x<<": "<<bitset<y>(x) << endl;

#define line() cerr << "---------------" << endl;



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

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



template<typename T>

   void printA(vector<T> &printArray, char between = ' ') {

   int paSize = printArray.size();

   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}

   if (between != '\n') {cerr << endl;}

}



// ------------------------------------------------------------------------------------------



int N;

vec<vec<int>> G;



void dfs(int pos, vec<int> &dist) {

   if (dist[pos] == -1) return;

   for (int to : G[pos]) {

      if (dist[to] == -1) {

         dist[to] = dist[pos] + 1;

         dfs(to, dist);

      }

   }

}



int main() {

   cin >> N;

   G = vec<vec<int>>(N);

   rep (i, N-1) {

      int a, b;

      cin >> a >> b;

      a--, b--;

      G[a].push_back(b);

      G[b].push_back(a);

   }

   vec<int> dist1(N, -1), dist2(N, -1);

   dist1[0] = 0;

   dfs(0, dist1);

   dist2[N-1] = 0;

   dfs(N-1, dist2);



   int b = 0, w = 0;

   rep (i, N) {

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

         b++;

      } else {

         w++;

      }

   }



   if (b > w) {

      puts("Fennec");

   } else {

      puts("Snuke");

   }



   return 0;

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

#include <vector>

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: 18.461023220861815x):
#include<cstdio>

struct edge{

	int to,nx;

}e[5000001];

int n,h[100001],p,d1[100001],d2[100001];

void ae(int fr,int to){e[++p]=(edge){to,h[fr]};h[fr]=p;}

void dfs1(int u,int fa,int d){d1[u]=d;for(int i=h[u];i;i=e[i].nx)if(e[i].to!=fa)dfs1(e[i].to,u,d+1);}

void dfs2(int u,int fa,int d){d2[u]=d;for(int i=h[u];i;i=e[i].nx)if(e[i].to!=fa)dfs2(e[i].to,u,d+1);}

int main(){

	scanf("%d",&n);for(int i=1,a,b;i<n;i++) scanf("%d%d",&a,&b),ae(a,b),ae(b,a);

	dfs1(1,-1,0);dfs2(n,-1,0);

	int s1=0,s2=0;

	for(int i=1;i<=n;i++)if(d1[i]<=d2[i])s1++;else s2++;

	return 0*printf("%s",s1>s2?"Fennec":"Snuke");

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

#include<string>

#include<math.h>

#include<stdlib.h>

#include<set>

#include<bitset>

#include<map>

#include<vector>

#include<string.h>

#include<algorithm>

#include<iostream>

#include<queue>

#include<deque>

#include<stack>

using namespace std;



const int INF=12345678;

int n,par,dist[100005];

vector<int> nei[100005],v;

queue<int> q;



void DFS(int x,int pr){

	dist[x]=1;

	v.push_back(x);

	if(x==n-1){

		par=v[(v.size()+1)/2];

		//return;

	}

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

		int now=nei[x][i];

		if(pr==now) continue;

		DFS(now,x);

		dist[x]+=dist[now];

	}

	v.pop_back();

}



int main(){

	cin>>n;

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

		int x,y;

		cin>>x>>y;

		x--;

		y--;

		nei[x].push_back(y);

		nei[y].push_back(x);

	}

	par=-1;

	DFS(0,0);

	if(dist[par]*2<n) puts("Fennec");

	else puts("Snuke");

	return 0;

}

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

struct edge{

	int to,nx;

}e[5000001];

int n,h[100001],p,d1[100001],d2[100001];

void ae(int fr,int to){e[++p]=(edge){to,h[fr]};h[fr]=p;}

void dfs1(int u,int fa,int d){d1[u]=d;for(int i=h[u];i;i=e[i].nx)if(e[i].to!=fa)dfs1(e[i].to,u,d+1);}

void dfs2(int u,int fa,int d){d2[u]=d;for(int i=h[u];i;i=e[i].nx)if(e[i].to!=fa)dfs2(e[i].to,u,d+1);}

int main(){

	scanf("%d",&n);for(int i=1,a,b;i<n;i++) scanf("%d%d",&a,&b),ae(a,b),ae(b,a);

	dfs1(1,-1,0);dfs2(n,-1,0);

	int s1=0,s2=0;

	for(int i=1;i<=n;i++)if(d1[i]<=d2[i])s1++;else s2++;

	return 0*printf("%s",s1>s2?"Fennec":"Snuke");

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

#include<cstdio>

#include<algorithm>

#include<queue>

#include<string>

#include<string.h>

#include<memory.h>

#include<vector>

#include<map>

#include<set>

#include<utility>

#include<sstream>

#include<cmath>

#include<list>

#include<deque>

#include<stack>

#include<ctime>

using namespace std;         //一遍dfs，利用nreach,son计算点的个数

vector<int> q;

vector<int> r[100100];

int son[100100];

int nreach,n;

int dfs(int a,int fa)

{q.push_back(a);

son[a]=1;

if(a==n) {nreach=q[(q.size()+1)/2];}

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

								{int nex=r[a][i];

								if(nex==fa) continue;

								son[a]+=dfs(nex,a);

								}

q.pop_back();

return son[a];

}

int main()

{cin>>n;

int a,b;

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

{cin>>a>>b;

r[a].push_back(b);

r[b].push_back(a);

}

int _=dfs(1,-1);

if(son[nreach]<son[1]-son[nreach])  cout<<"Fennec";

else cout<<"Snuke";

return 0;

}


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

struct edge{

	int to,nx;

}e[5000001];

int n,h[100001],p,d1[100001],d2[100001];

void ae(int fr,int to){e[++p]=(edge){to,h[fr]};h[fr]=p;}

void dfs1(int u,int fa,int d){d1[u]=d;for(int i=h[u];i;i=e[i].nx)if(e[i].to!=fa)dfs1(e[i].to,u,d+1);}

void dfs2(int u,int fa,int d){d2[u]=d;for(int i=h[u];i;i=e[i].nx)if(e[i].to!=fa)dfs2(e[i].to,u,d+1);}

int main(){

	scanf("%d",&n);for(int i=1,a,b;i<n;i++) scanf("%d%d",&a,&b),ae(a,b),ae(b,a);

	dfs1(1,-1,0);dfs2(n,-1,0);

	int s1=0,s2=0;

	for(int i=1;i<=n;i++)if(d1[i]<=d2[i])s1++;else s2++;

	return 0*printf("%s",s1>s2?"Fennec":"Snuke");

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

using namespace std;

#define ll long long



const int NMAX = 1e5+1;



int parent[NMAX], n;

int subnodes[NMAX];

bool visited[NMAX];

vector<int> adj[NMAX];



void dfs(int node){

	visited[node] = true;

	for(int v : adj[node]){

		if(!visited[v]){

			dfs(v);

			parent[v] = node;

			subnodes[node] += subnodes[v];

		}

	}

	subnodes[node]++;

}



bool ans(){

	vector<int> q;

	int node = n - 1;

	parent[0] = -1;

	while(node != -1){

		q.push_back(node);

		node = parent[node];

	}

	int len = q.size(), fennec = len>>1, i = 0;

	ll a = 0, b = 0;

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

		node = q[i];

		for(int v : adj[node]){

			if((i == 0 ||(i > 0 && q[i-1] != v)) && (i + 1 == len||(i + 1 < len && q[i+1] != v))){

				if(i >= fennec){

					a += subnodes[v];

				}else{

					b += subnodes[v];

				}

			}

		}

	}

	if(len%2 == 0){

		return a > b;

	}else{

		return a >= b;

	}

}



int main()

{

	ios::sync_with_stdio(false);cin.tie(NULL);

	cin >> n;

	int a, b;

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

		cin >> a >> b;

		a--;

		b--;

		adj[a].push_back(b);

		adj[b].push_back(a);

	}

	dfs(0);

	if(ans()){

		cout << "Fennec";

	}else{

		cout << "Snuke";

	}

	return 0;

}




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

struct edge{

	int to,nx;

}e[5000001];

int n,h[100001],p,d1[100001],d2[100001];

void ae(int fr,int to){e[++p]=(edge){to,h[fr]};h[fr]=p;}

void dfs1(int u,int fa,int d){d1[u]=d;for(int i=h[u];i;i=e[i].nx)if(e[i].to!=fa)dfs1(e[i].to,u,d+1);}

void dfs2(int u,int fa,int d){d2[u]=d;for(int i=h[u];i;i=e[i].nx)if(e[i].to!=fa)dfs2(e[i].to,u,d+1);}

int main(){

	scanf("%d",&n);for(int i=1,a,b;i<n;i++) scanf("%d%d",&a,&b),ae(a,b),ae(b,a);

	dfs1(1,-1,0);dfs2(n,-1,0);

	int s1=0,s2=0;

	for(int i=1;i<=n;i++)if(d1[i]<=d2[i])s1++;else s2++;

	return 0*printf("%s",s1>s2?"Fennec":"Snuke");

}