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

#include <bits/stdc++.h>

using namespace std;

/*---define tricks---*/

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

#define UN(v) sort(ALL(v)),v.erase(unique(ALL(v)),v.end())

#define FILL(x,y) memset(x,y,sizeof(x))

#define EACH(v,it) for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)

#define FIO ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)

#define revsort(b,e) sort(b,e),reverse(b,e)

#define X first

#define Y second

/*---define types---*/

typedef long long ll;

typedef list<int> li;

typedef queue<int> qi;

typedef deque<int> dqi;

typedef vector<int> vi;

typedef pair<int,int> pii;

typedef vector<pii> vii;

typedef pair<ll,ll> pll;

typedef pair<ll,int> pli;

typedef unsigned int uint;

/*---define variables---*/

const int inf=(1<<29);

int n;

vi E[100005];

int dis[100005][2];

/*---define function---*/



void DFS(int x,const int& pre,const int& num)

{

	EACH(E[x],it)

	{

		int y=*it;

		if(y!=pre)

		{

			dis[y][num]=dis[x][num]+1;

			DFS(y,x,num);

		}

	}

}



/*---main code---*/

int main()

{

	FIO;

	cin>>n;

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

	{

		int x,y;

		cin>>x>>y;

		E[x].push_back(y);

		E[y].push_back(x);

	}

	DFS(1,-1,0);

	DFS(n,-1,1);

	int cntf=0,cnts=0;

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

	{

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

		{

			cntf++;

		}

		else

		{

			cnts++;

		}

	}

	if(cntf>cnts)

	{

		puts("Fennec");

	}

	else

	{

		puts("Snuke");

	}

	return 0;

}


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

vector<int> bfs(int n,vector<vector<int> >&G,int s){

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

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

	while(!q.empty()){

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

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

			int to=G[u][i];

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

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

				q.push(to);

			}

		}

	}

	return d;

}

int main(){

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

    int n;

	cin>>n;

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

	rep(i,n-1){

		int a,b;

		cin>>a>>b;

		a--;b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	vector<int>d1=bfs(n,G,0);

	vector<int>d2=bfs(n,G,n-1);

	int n1=0,n2=0;

	rep(i,n){

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

		else n2++;

	}

	string ans=n1>n2?"Fennec":"Snuke";

	cout<<ans<<endl;

	return 0;

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

#include <bitset>

#include <cmath>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <deque>

#include <list>

#include <map>

#include <iomanip>

#include <iostream>

#include <queue>

#include <set>

#include <stack>

#include <string>

#include <utility>

#include <vector>

#define fi first

#define se second

#define pb push_back

//#define mp make_pair

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

using namespace std;

typedef long long LL;

typedef pair<int,int> pii;

const int INF=0x3f3f3f3f;

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

//const int MOD=998244353;

const int N=2e5+10;



inline int read(){

	int ww=1,xx=0;char ch=getchar();

	while(!isdigit(ch)){if(ch=='-') ww=-ww;ch=getchar();}

	while(isdigit(ch)){xx=(xx<<1)+(xx<<3)+(ch^48);ch=getchar();}

	return ww*xx;

}



int n;

int num[N];

int q[N];

int head[N];

int cnt,tmp;

bool f;

int ans;



struct Edge{

	int to,nxt;

}ed[N];



void add_edge(int a,int b){

	ed[++cnt].to=b;

	ed[cnt].nxt=head[a];

	head[a]=cnt;

}



void dfs(int u,int p){

//	printf("%d ",u);

	if(!f) q[tmp++]=u;

	if(u==n) f=true;

	for(int i=head[u];i!=-1;i=ed[i].nxt){

		int v=ed[i].to;

		if(v!=p){

			dfs(v,u);

			num[u]+=num[v]+1;

		}

	}

	if(!f) --tmp;

	return ;

}



signed main(){

//	freopen(".in","r",stdin);

//	freopen(".out","w",stdout);

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

	n=read();

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

		int fr,to;

		fr=read();

		to=read();

		add_edge(fr,to);

		add_edge(to,fr);

	}

	tmp=1;

	dfs(1,-1);

//	for(int i=1;i<tmp;i++) printf("%d ",q[i]);

	for(int i=1;i<=tmp/2;i++) ans+=num[q[i]]-num[q[i+1]];

	if(ans>n-ans) puts("Fennec");

	else puts("Snuke");

	return 0;

}

/*

7

3 6

1 2

3 1

7 4

5 7

1 4



4

1 4

4 2

2 3

*/

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

vector<int> bfs(int n,vector<vector<int> >&G,int s){

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

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

	while(!q.empty()){

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

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

			int to=G[u][i];

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

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

				q.push(to);

			}

		}

	}

	return d;

}

int main(){

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

    int n;

	cin>>n;

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

	rep(i,n-1){

		int a,b;

		cin>>a>>b;

		a--;b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	vector<int>d1=bfs(n,G,0);

	vector<int>d2=bfs(n,G,n-1);

	int n1=0,n2=0;

	rep(i,n){

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

		else n2++;

	}

	string ans=n1>n2?"Fennec":"Snuke";

	cout<<ans<<endl;

	return 0;

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

using namespace std;

const int inf=1<<30;

int dist[100010],dist2[100010];

vector<int> g[100010];

void dfs(int now,int par,int d){

	dist[now]=d;

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

		if(g[now][i]!=par){

			dfs(g[now][i],now,d+1);

		}

	}

}

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

	}

	dfs(n,0,0);

	for(int i=0;i<100010;i++)dist2[i]=dist[i];

	dfs(1,0,0);

	int fec=0,snk=0;

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

		if(dist2[i]>=dist[i])fec++;

		else snk++;

	}

	if(fec>snk)cout<<"Fennec"<<endl;

	else cout<<"Snuke"<<endl;

	return 0;

}

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

using namespace std;

typedef long long ll;

ll par[100009],vis[100009],vis2[100009];

vector<ll> v[100009];

void bfs(ll node,ll n)

{

    vis[node] = 1;

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

        par[i] = -1;

    queue<ll> q;

    q.push(node);

    while(!q.empty())

    {

        ll temp = q.front();

        q.pop();



        if(temp==n)

            break;

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

        {

            if(vis[v[temp][i]]==0)

            {

                vis[v[temp][i]]= 1;

                q.push(v[temp][i]);

                par[v[temp][i]] = temp;

            }

        }

    }

}

ll bfs2(ll node)

{

    vis2[node] = 1;

    queue<ll> q;

    q.push(node);

    ll cnt = 1;

    while(!q.empty())

    {

        ll temp = q.front();

        q.pop();

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

        {

            if(vis2[v[temp][i]]==0)

            {

                cnt++;

                vis2[v[temp][i]]= 1;

                q.push(v[temp][i]);

            }

        }

    }

    return cnt;

}

vector<ll> p;

void path(ll n)

{



    if(n==-1)

        return;

    path(par[n]);

    p.push_back(n);

}

int main()

{

    ll i,n,j,x,y;

    cin>>n;

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

    {

        cin>>x>>y;

        v[x].push_back(y);

        v[y].push_back(x);



    }

    bfs(1,n);

    path(n);

    vector<ll> v1,v2;

    for(i=0,j=p.size()-1;i<=j;i++,j--)

    {

        v1.push_back(p[i]);

        v2.push_back(p[j]);

        vis2[p[i]] = 1;

        vis2[p[j]] = 2;

    }

    ll pq = 0;



    for(i=0;i<v1.size();i++)

    {

        pq+= bfs2(v1[i]);

    }

    if(pq<=n-pq)

    {

        cout<<"Snuke"<<endl;

    }

    else cout<<"Fennec"<<endl;







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

using namespace std;

const int N=100005;

int n,a,b,dep,p,q;

int vis[N],path[N];

vector<int>e[N];

int dfs1(int now,int deep)

{

	vis[now]=1;

	if(now==n)

	{

		dep=deep;

		return 1;

	}

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

	{

		if(vis[e[now][i]])

			continue;

		path[deep]=e[now][i];

		if(dfs1(e[now][i],deep+1))

			return 1;

	}

	return 0;

}

int dfs2(int now)

{

	vis[now]=1;

	int sum=1;

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

		if(!vis[e[now][i]])

			sum+=dfs2(e[now][i]);

	return sum;

}

int main()



{

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

	}

	path[0]=1;

	dfs1(1,1);

	//1:(0)---(dep/2),(dep/2+1)---(dep-1)  2:(0)---(dep/2-1),(dep/2)---(dep-1)

 	memset(vis,0,sizeof(vis));

 	p=dfs2(1);

	if(dep%2)

	{

		memset(vis,0,sizeof(vis));

		for(int i=0;i<=dep/2;i++)

			vis[path[i]]=1;

		q=dfs2(path[dep/2+1]);

		if(p-q>q)

			printf("Fennec\n");

		else

			printf("Snuke\n");

	}

	else

	{

		memset(vis,0,sizeof(vis));

		for(int i=0;i<=dep/2-1;i++)

			vis[path[i]]=1;

		q=dfs2(path[dep/2]);

		if(p-q>q)

			printf("Fennec\n");

		else

			printf("Snuke\n");

	}

	return 0;

}


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

using namespace std;

typedef long long ll;

ll par[100009],vis[100009],vis2[100009];

vector<ll> v[100009];

void bfs(ll node,ll n)

{

    vis[node] = 1;

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

        par[i] = -1;

    queue<ll> q;

    q.push(node);

    while(!q.empty())

    {

        ll temp = q.front();

        q.pop();



        if(temp==n)

            break;

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

        {

            if(vis[v[temp][i]]==0)

            {

                vis[v[temp][i]]= 1;

                q.push(v[temp][i]);

                par[v[temp][i]] = temp;

            }

        }

    }

}

ll bfs2(ll node)

{

    vis2[node] = 1;

    queue<ll> q;

    q.push(node);

    ll cnt = 1;

    while(!q.empty())

    {

        ll temp = q.front();

        q.pop();

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

        {

            if(vis2[v[temp][i]]==0)

            {

                cnt++;

                vis2[v[temp][i]]= 1;

                q.push(v[temp][i]);

            }

        }

    }

    return cnt;

}

vector<ll> p;

void path(ll n)

{



    if(n==-1)

        return;

    path(par[n]);

    p.push_back(n);

}

int main()

{

    ll i,n,j,x,y;

    cin>>n;

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

    {

        cin>>x>>y;

        v[x].push_back(y);

        v[y].push_back(x);



    }

    bfs(1,n);

    path(n);

    vector<ll> v1,v2;

    for(i=0,j=p.size()-1;i<=j;i++,j--)

    {

        v1.push_back(p[i]);

        v2.push_back(p[j]);

        vis2[p[i]] = 1;

        vis2[p[j]] = 2;

    }

    ll pq = 0;



    for(i=0;i<v1.size();i++)

    {

        pq+= bfs2(v1[i]);

    }

    if(pq<=n-pq)

    {

        cout<<"Snuke"<<endl;

    }

    else cout<<"Fennec"<<endl;







}
// 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: 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 <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.498225335847716x):
#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:
/* long long or int & the MAX_INT or MIN_INT */

/* the size of a[] & inline */

/* xx 396 */



#include<bits/stdc++.h>

using namespace std;



const int MAX_N=1e5+10;



vector <int> G[MAX_N],Main,now;

int col[MAX_N],N;



inline void dfs(int at,int p){

	now.push_back(at);

	if(at==N-1) Main=now;

	for(int i=0;i<G[at].size();i++){

		int to=G[at][i];

		if(to!=p) dfs(to,at);

	}

	now.resize(now.size()-1);

}



inline void color(int at,int p){

	int c=col[at];

	for(int i=0;i<G[at].size();i++){

		int to=G[at][i];

		if(col[to]==-1) col[to]=c;

		if(to!=p) color(to,at);

	}

}



signed main(){

	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	for(int i=0;i<MAX_N;i++) col[i]=-1;

	cin>>N;

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

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

		G[a].push_back(b); G[b].push_back(a);

	}	

	dfs(0,-1);

	for(int i=0;i<(Main.size()+1)/2;i++) col[Main[i]]=1;

	for(int i=(Main.size()+1)/2;i<Main.size();i++) col[Main[i]]=0;

	color(0,-1);

	int sum1=0,sum2=0;

	for(int i=0;i<N;i++) if(col[i]==1) sum1++;

	for(int i=0;i<N;i++) if(col[i]==0) sum2++;

	if(sum1>sum2) cout<<"Fennec"<<endl;

	else cout<<"Snuke"<<endl;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1144899284711625x):
/* long long or int & the MAX_INT or MIN_INT */

/* the size of a[] & inline */

/* xx 396 */



#include<bits/stdc++.h>

using namespace std;



const int MAX_N=1e5+10;



int cnt[MAX_N],N;

vector <int> G[MAX_N];

int First;

vector <int> Main;



inline void dfs(int at,int p){

	cnt[at]=1; Main.push_back(at);

	if(at==N-1) First=Main[(Main.size()+1)/2];

	for(int i=0;i<G[at].size();i++){

		int to=G[at][i];

		if(to!=p){

			dfs(to,at);

			cnt[at]+=cnt[to];

		}

	}

	Main.resize(Main.size()-1);

}



signed main(){

	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	cin>>N;

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

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

		G[a].push_back(b); G[b].push_back(a);

	}

	dfs(0,-1);

	bool win=cnt[First]*2<N;

	if(win) cout<<"Fennec"<<endl;

	else cout<<"Snuke"<<endl;

	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.501380271209457x):
#include<bits/stdc++.h>



using namespace std;



vector<vector<int> > g;



void go(int u, int w, vector<int> &d, int p = -1) {

    d[u] = w;

    for(auto v : g[u]) {

        if(v != p) {

            go(v, w+1, d, u);

        }

    }

}



int main() {

    #ifdef LOCAL

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

        freopen("output.txt", "w", stdout);

    #else

        #define endl '\n'

    #endif



    int n; cin >> n;

//    cout << "asdasd" << endl;

    g.assign(n+1, vector<int>());

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

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

        g[a].push_back(b);

        g[b].push_back(a);

    }

    vector<int> d1(n+1), d2(n+1);

    go(1, 0, d1);

    go(n, 0, d2);



    int wina = 0, winb = 0;

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

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

            wina++;

        else

            winb++;

    }



//    cout << wina << " " << winb << endl;



    if(wina > winb) cout << "Fennec" << endl;

    else cout << "Snuke" << endl;



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

#include <cstdio>

#include <cmath>

#include <algorithm>

#include <string>

#include <vector>

#include <map>

#include <queue>

#include <deque>

#include <set>

#include <sstream>

#include <utility>

#include <list>

#include <ctime>

#include <memory>



using namespace std;



int n,visit[100010]={},dis[100010]={},dis2[100010]={};

vector<int> tree[100010];



void BFS(int x,int d)

{

	visit[x]=1;

	dis[x]=d;

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

		if(!visit[tree[x][i]]){

			//cout << "BFS on x="<<tree[x][i]<<"    d="<<d+1<<endl; 

			BFS(tree[x][i],d+1);

		}

	}

}



int main()

{	

	//input yabbi

	cin >> n;



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

		int a,b;

		cin >> a >> b;

		tree[a].push_back(b);

		tree[b].push_back(a);

	}

	

	

	//bfs yabbi

	BFS(1,0);

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

		dis2[i]=dis[i];

		visit[i]=0;

	}

		//cout <<"I am a line...."<<endl;

	BFS(n,0);



	int w=0,b=0;

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

		if(dis2[i]>dis[i])w++;

		else b++;

	}

	

	if(w>=b)cout << "Snuke" << endl;

	else cout << "Fennec" << endl;

	

	return 0;

}


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



using namespace std;



vector<vector<int> > g;



void go(int u, int w, vector<int> &d, int p = -1) {

    d[u] = w;

    for(auto v : g[u]) {

        if(v != p) {

            go(v, w+1, d, u);

        }

    }

}



int main() {

    #ifdef LOCAL

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

        freopen("output.txt", "w", stdout);

    #else

        #define endl '\n'

    #endif



    int n; cin >> n;

//    cout << "asdasd" << endl;

    g.assign(n+1, vector<int>());

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

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

        g[a].push_back(b);

        g[b].push_back(a);

    }

    vector<int> d1(n+1), d2(n+1);

    go(1, 0, d1);

    go(n, 0, d2);



    int wina = 0, winb = 0;

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

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

            wina++;

        else

            winb++;

    }



//    cout << wina << " " << winb << endl;



    if(wina > winb) cout << "Fennec" << endl;

    else cout << "Snuke" << endl;



}
// 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.2381140915812545x):
#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;

}