stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <iostream>

#include <stdio.h>

#include <string.h>

#include <algorithm>

#include <vector>

using namespace std;

#define LL long long

#define MX 100010

  

int n;

int total;

vector<int> G[MX];

int colr[MX];



void DFS(int x,int pre,int c,int &tot)

{

    if (colr[x]==-c) return;

    tot++;

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

       if (G[x][i]!=pre)

            DFS(G[x][i],x,c,tot);

}



void dfs(int u,int pre,int s,int &ok)

{

    if (u==n)

    {

        ok=s;

        return;

    }

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

    {

        if (ok) break;

        if (G[u][i]!=pre)

            dfs(G[u][i],u,s+1,ok);

    }

    if (ok)

    {

        if (u!=1&&s<=ok/2) colr[u]=1;

        if (u!=n&&s>ok/2) colr[u]=-1;

    }

    return;

}

int main()

{

    scanf("%d",&n);

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

    {

        int u,v;

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

        G[u].push_back(v);

        G[v].push_back(u);

    }

    colr[1]=1; //hei

    colr[n]=-1;//bai



    int ok=0;

    dfs(1,-10,0,ok);





    int num_1=0;

    DFS(1,-10,1,num_1);

    int num_2=0;

    DFS(n,-10,-1,num_2);

    if (num_1-num_2>=1)

        printf("Fennec\n");

    else

        printf("Snuke\n");

    return 0;

}

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

int d[2][100010],w=0;

int ta[100010],to[200010],nt[200010];

void f(int s){

  int i,j,t,r,q[100010];

  d[w][q[t=0]=s]=1;

  for(r=1;r-t;t++){

    for(i=ta[q[t]];i+1;i=nt[i]){

      if(d[w][to[i]])continue;

      d[w][to[i]]=d[w][q[t]]+1;

      q[r++]=to[i];

    }

  }

}

int main(){

  int n,a,b,i;

  scanf("%d",&n);

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

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

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

    nt[i    ]=ta[to[i+n]=a];

    nt[i+n  ]=ta[to[i  ]=b];

    ta[a]=i;

    ta[b]=i+n;

  }

  f(1);

  w++;//for(i=1;i<=n;i++)printf("%d %d\n",d[0][i],d[1][i]);

  f(n);

  for(i=a=b=0;i<n;i++){

    if(d[0][i+1]>d[1][i+1])b++;

    else a++;

  }

  //for(i=1;i<=n;i++)printf("%d %d\n",d[0][i],d[1][i]);

  printf("%s\n",b<a?"Fennec":"Snuke");

  return 0;

}

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

#include <string>

#include <cstdio>

#include <vector>

#include <queue>

#include <list>

#include <cstdlib>

#include <algorithm>

#include <set>

#include <map>

#include <deque>

#include <cstring>

#include <cmath>

//#include<bits/stdc++.h>

using namespace std;



const int INF=0x3f3f3f3f;

const int SIZE=100005;



vector<int> mp[SIZE];

int color[SIZE],dist[SIZE],dist2[SIZE];

bool vis[SIZE];



void bfs(int s,int dist[]){

	queue<int> que;

	que.push(s);

	while(!que.empty()){

		int u=que.front();

		que.pop();

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

			int t=mp[u][i];

			if(dist[t] || t==s) continue;

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

			que.push(t);

		}

	}

}



void go(int p,int left,int col,int dist[]){

	if(color[p]) return;

	if(!left) return;

	color[p]=col;

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

		int u=mp[p][i];

		if(dist[u]>dist[p]) continue;

		go(u,left-1,col,dist);

	}

}



void go2(int p){

	if(color[p]==2) return;

	if(vis[p]) return;

	vis[p]=true;

	color[p]=1;

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

		int u=mp[p][i];

		go2(u);

	}

}



int main(){

	int n;

	cin>>n;

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

		cin>>a>>b;

		a--;

		b--;

		mp[a].push_back(b);

		mp[b].push_back(a);

	}

	bfs(n-1,dist);

	bfs(0,dist2);

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

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

//	}

//	cout<<endl;

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

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

//	}

//	cout<<endl;

	int s=(dist[0]+1)/2;

	int f=(dist[0]+1)-s;

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

	go(0,f,1,dist);

	go(n-1,s,2,dist2);

//	int ttt=0;

//	for(int i=0;i<n;i++) if(color[i]==2) ttt++;

//	cout<<ttt<<endl;

	go2(0);

	f=0;

	for(int i=0;i<n;i++) if(color[i]==1) f++;

	s=n-f;

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

	if(s>=f){

		cout<<"Snuke\n";

	}

	else{

		cout<<"Fennec\n";

	}

	return 0;

}


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

int d[2][100010],w=0;

int ta[100010],to[200010],nt[200010];

void f(int s){

  int i,j,t,r,q[100010];

  d[w][q[t=0]=s]=1;

  for(r=1;r-t;t++){

    for(i=ta[q[t]];i+1;i=nt[i]){

      if(d[w][to[i]])continue;

      d[w][to[i]]=d[w][q[t]]+1;

      q[r++]=to[i];

    }

  }

}

int main(){

  int n,a,b,i;

  scanf("%d",&n);

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

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

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

    nt[i    ]=ta[to[i+n]=a];

    nt[i+n  ]=ta[to[i  ]=b];

    ta[a]=i;

    ta[b]=i+n;

  }

  f(1);

  w++;//for(i=1;i<=n;i++)printf("%d %d\n",d[0][i],d[1][i]);

  f(n);

  for(i=a=b=0;i<n;i++){

    if(d[0][i+1]>d[1][i+1])b++;

    else a++;

  }

  //for(i=1;i<=n;i++)printf("%d %d\n",d[0][i],d[1][i]);

  printf("%s\n",b<a?"Fennec":"Snuke");

  return 0;

}

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

using namespace std;

int n,a,b;vector<int> g[100005];int d1[100005],d2[100005];void dfs(int r,int f,int d,int dist[]){dist[r]=d;for(int x=0;x<g[r].size();x++)if(g[r][x]!=f)dfs(g[r][x],r,d+1,dist);}int main(){cin>>n;for(int i=0;i<n-1;i++){cin>>a>>b;a--,b--;g[a].push_back(b);g[b].push_back(a);}dfs(0,-1,0,d1);dfs(n-1,-1,0,d2);int ans=0;for(int i=0;i<n;i++)if(d1[i]<=d2[i])ans++;else ans--;if(ans>0)cout <<"Fennec"<< endl;else cout<<"Snuke"<<endl;}

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

using namespace std;



int dis0[100005], dis1[100005];



struct edge {

    int to, next;

} eg[200010];

int head[100005], tot = 0;



void init() {

    memset(head, 0xff, sizeof(head));

    tot = 0;

}



void addedge(int from, int to) {

    eg[tot] = {to, head[from]};

    head[from] = tot++;

}



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

    if(pa != -1) d[u] = d[pa] + 1;

    else d[u] = 0;

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

        int to = eg[i].to;

        if(to != pa) {

            dfs(to, u, d);

        }

    }

}



int main() {

    int n;

    scanf("%d", &n);

    init();

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

        int u, v;

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

        addedge(u, v);

        addedge(v, u);

    }

    dfs(1, -1, dis0);

    dfs(n, -1, dis1);

    int lcnt = 0, rcnt = 0;

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

//        printf("%d %d\n", dis0[i], dis1[i]);

//    }

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

        if(dis0[i] <= dis1[i]) ++lcnt;

        else ++rcnt;

    }

//    printf("%d %d\n", lcnt, rcnt);

    if(lcnt > rcnt) {

        puts("Fennec");

    } else {

        puts("Snuke");

    }

    return 0;

}


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

using namespace std;

const int maxn=1e5+10;



vector<int> g[maxn];

int dis1[maxn],dis2[maxn];



void init() {

    memset(dis1,0,sizeof(dis1));

    memset(dis2,0,sizeof(dis2));

    for(int i=0;i<maxn;i++)g[i].clear();

}



void dfs(int x,int f,int dis[],int dep){

    dis[x]=dep;

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

        if(g[x][i]!=f)dfs(g[x][i],x,dis,dep+1);

    }

}



int main() {

    int n,x,y;

    while(scanf("%d",&n)!=EOF) {

        init();

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

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

            g[x].push_back(y);

            g[y].push_back(x);

        }

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

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

        int cnt=0;

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

            if(dis1[i]<=dis2[i])cnt++;

            else cnt--;

        }

        if(cnt>0){

            puts("Fennec");

        }else{

            puts("Snuke");

        }

    }

    return 0;

}


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

using namespace std;



int dis0[100005], dis1[100005];



struct edge {

    int to, next;

} eg[200010];

int head[100005], tot = 0;



void init() {

    memset(head, 0xff, sizeof(head));

    tot = 0;

}



void addedge(int from, int to) {

    eg[tot] = {to, head[from]};

    head[from] = tot++;

}



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

    if(pa != -1) d[u] = d[pa] + 1;

    else d[u] = 0;

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

        int to = eg[i].to;

        if(to != pa) {

            dfs(to, u, d);

        }

    }

}



int main() {

    int n;

    scanf("%d", &n);

    init();

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

        int u, v;

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

        addedge(u, v);

        addedge(v, u);

    }

    dfs(1, -1, dis0);

    dfs(n, -1, dis1);

    int lcnt = 0, rcnt = 0;

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

//        printf("%d %d\n", dis0[i], dis1[i]);

//    }

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

        if(dis0[i] <= dis1[i]) ++lcnt;

        else ++rcnt;

    }

//    printf("%d %d\n", lcnt, rcnt);

    if(lcnt > rcnt) {

        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 a,b,n;

vector<int> g[100005];

int distance_Fennec[100005]; //ふぇねえええええええええええええええええええええええええええええっく

int distance_Sunuke[100005];



void calc_distance(int r, int f, int d, int dist[]) {

	dist[r] = d;

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

		if (g[r][x] != f) calc_distance(g[r][x], r, d + 1, dist);

			

}

int main()

{

	cin>>n;

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

		cin>>a>>b;

		a--,b--;

		g[a].push_back(b);

		g[b].push_back(a);

	}

	calc_distance(0  ,-1,0,distance_Fennec);

	calc_distance(n-1,-1,0,distance_Sunuke);

	int ans = 0;

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

		if(distance_Fennec[i] <= distance_Sunuke[i]) ans++;

		else ans--;

	}

	printf("%s\n",(ans > 0) ? "Fennec" : "Snuke");

}

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



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

vector<bool> seen;

void dfs(const Graph &G,int v,int before,int step,vector<int> &Array) {

		Array[v]=step;

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

			if(G[v][i]!=before) dfs(G,G[v][i],v,step+1,Array);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

	vector<int> Fennec(N+10);

	vector<int> Sunuke(N+10);

	Graph G(N+10);

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

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(G,0,-1,0,Fennec);

	dfs(G,N-1,-1,0,Sunuke);



//	for(int i=0;i<N;i++) cout<<Fennec[i]<<" ";

//	cout<<endl;

//	for(int i=0;i<N;i++) cout<<Sunuke[i]<<" ";

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	printf("%s",(ans>0)?"Fennec":"Snuke");

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
/*  include  */

#include <bits/stdc++.h>



/*  using namespace  */

using namespace std;



/*  local var  */

int a,b,n;		//input

int ans = 0;		//output

vector<int> g[100005];  //graph

int distance_Fennec[100005]; //Distance from ふぇねええええええええええええええええええええええええっく

int distance_Sunuke[100005]; //Distance from Snuke



/*  define  */

#define loop(i,j) for(int i = 0; i < j; i++)



/*  typedef  */

//None



/*  distance checker  */

void calc_distance(int r, int f, int d, int dist[]) {

	dist[r] = d;

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

		if (g[r][x] != f) calc_distance(g[r][x], r, d + 1, dist);

			

}



/*  main program  */

int main()

{

	cin>>n;



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

		cin>>a>>b;

		a--,b--;

		g[a].push_back(b);

		g[b].push_back(a);

	}



	calc_distance(0  ,-1,0,distance_Fennec);

	calc_distance(n-1,-1,0,distance_Sunuke);



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

		if(distance_Fennec[i] <= distance_Sunuke[i]) ans++;

		else ans--;

	}



	printf("%s\n",(ans > 0) ? "Fennec" : "Snuke");

}


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



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

vector<bool> seen;

void dfs(const Graph &G,int v,int before,int step,vector<int> &Array) {

		Array[v]=step;

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

			if(G[v][i]!=before) dfs(G,G[v][i],v,step+1,Array);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

	vector<int> Fennec(N+10);

	vector<int> Sunuke(N+10);

	Graph G(N+10);

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

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	dfs(G,0,-1,0,Fennec);

	dfs(G,N-1,-1,0,Sunuke);



//	for(int i=0;i<N;i++) cout<<Fennec[i]<<" ";

//	cout<<endl;

//	for(int i=0;i<N;i++) cout<<Sunuke[i]<<" ";

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	printf("%s",(ans>0)?"Fennec":"Snuke");

}


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



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

Graph G(200005);

vector<int> Fennec(200005);

vector<int> Sunuke(200005);

void dfs(int v,int before,int step,bool f) {

		if(f) Fennec[v]=step;

		else Sunuke[v]=step;

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

			if(G[v][i]!=before) dfs(G[v][i],v,step+1,f);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

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

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

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

	dfs(N-1,-1,0,false);



//	for(int i=0;i<N;i++) cout<<Fennec[i]<<" ";

//	cout<<endl;

//	for(int i=0;i<N;i++) cout<<Sunuke[i]<<" ";

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	printf("%s",(ans>0)?"Fennec":"Snuke");

}


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



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

Graph G(100005);

int Fennec[100005];

int Sunuke[100005];



void dfs(int v,int before,int step,bool f) {

		if(f) Fennec[v]=step;

		else Sunuke[v]=step;

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

			if(G[v][i]!=before) dfs(G[v][i],v,step+1,f);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

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

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

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

	dfs(N-1,-1,0,false);

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

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

}


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



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

Graph G(100005);

vector<int> Fennec(100005);

vector<int> Sunuke(100005);

void dfs(int v,int before,int step,bool f) {

		if(f) Fennec[v]=step;

		else Sunuke[v]=step;

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

			if(G[v][i]!=before) dfs(G[v][i],v,step+1,f);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

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

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

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

	dfs(N-1,-1,0,false);



//	for(int i=0;i<N;i++) cout<<Fennec[i]<<" ";

//	cout<<endl;

//	for(int i=0;i<N;i++) cout<<Sunuke[i]<<" ";

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

	printf("%s",(ans>0)?"Fennec":"Snuke");

}


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



#define sd1(a) scanf("%d",&a)

#define sd2(a,b) scanf("%d %d",&a,&b)



using namespace std;

using Graph = vector<vector<int>>;



// 深さ優先探索

Graph G(100005);

int Fennec[100005];

int Sunuke[100005];



void dfs(int v,int before,int step,bool f) {

		if(f) Fennec[v]=step;

		else Sunuke[v]=step;

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

			if(G[v][i]!=before) dfs(G[v][i],v,step+1,f);

}



int main()

{

	int a,b;

	int N;

	int ans=0;

	sd1(N);

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

		sd2(a,b);

		a--,b--;

		G[a].push_back(b);

		G[b].push_back(a);

	}

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

	dfs(N-1,-1,0,false);

	for(int i=0;i<N;i++) ans+=(Fennec[i]<=Sunuke[i])?1:-1;

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

}


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

#include <vector>

using namespace std;

#define ll long long 

int n;

vector<int> g[200005];

int d1[100005],d2[100005];

inline void dfs(int r,int f,int d,int dist[])

{

    dist[r]=d;

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

        if(g[r][x]!=f){

        	dfs(g[r][x],r,d+1,dist);

		}

    }

}

int main()

{

    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,0,d1);

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

    int ans=0;

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

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

            ans++;

		}

        else{

        	ans--;

        }

    }

    if(ans>0){

    	cout <<"Fennec"<< endl;

	}

    else{

    	cout<<"Snuke"<<endl;

	}

    return 0;

}

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

#include<string>

#include<stdlib.h> 

#include<cstring>

#include<map>

#include<list>

#include<stdio.h>

#include<cmath>

#include<iomanip>

#include<bitset>

#include<vector>

#include<time.h>

#include<algorithm> 

#include<queue>

#include<set>

#include<deque>

#define mod 1e9+7

#define inf 1e18 

typedef long long ll;

typedef long double ld;

using namespace std;

typedef list<ll> li;

typedef list<ll>::iterator lt;

li sh_r;

ll N,s;

vector<li>a;

bool dfs(ll step,ll x,ll f){

	if(x>N)cout<<f<<" "<<x<<endl;

	if(x==N){

	  s=step;

	  return true;

    }

	for(lt it=a[x].begin();it!=a[x].end();it++){

		if(*it==f)continue;

		if(dfs(step+1,*it,x)){

			sh_r.push_back(x);

			return true;

		}

	}

	return false;

}

ll num(ll x,ll f){

	ll n=1;

	for(lt it=a[x].begin();it!=a[x].end();it++){

		if(*it==f)continue;

		n+=num(*it,x);

	}

	return n;

}

int main(){	

    cin>>N;

    a.resize(N+10);

    for(ll K=1;K<N;K++){

    	ll x,y;

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

    	a[x].push_back(y);

    	a[y].push_back(x);

	}

	dfs(0,1,-1);

	s--;

	ll F=1,S=N;

	if(N!=2){

		ll j=s/2;

		for(lt it=sh_r.begin();it!=sh_r.end();it++){

			j--;

			if(j==0)S=*it;

			if(j==-1){

				F=*it;

				break;

			}

		}

	}

	ll Fen=num(F,S);

	ll Snu=num(S,F);

	if(Fen>Snu)printf("Fennec");

	else printf("Snuke");

	return 0;

}

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

using namespace std;

#define ll long long int

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

#define rrep(i,n) for( int i = n; i >= 0; i-- )

#define REP(i,s,t) for( int i = s; i <= t; i++ )

#define RREP(i,s,t) for( int i = s; i >= t; i-- )

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define INF 2000000000

#define mod 1000000007

#define INF2 1000000000000000000



vector<int> G[100010];

int L[2][100010];





void dfs(int T, int V, int cost) {

	L[T][V] = cost;

	rep(i, G[V].size()) {

		if (L[T][G[V][i]] != INF) continue;

		dfs(T, G[V][i], cost + 1);

	}

}



int main(void)

{

    cin.tie(0);

    ios::sync_with_stdio(false);



	int N;

	cin >> N;

	rep(i, N-1) {

		int a, b;

		cin >> a >> b;

		G[a].push_back(b);

		G[b].push_back(a);

	}

	rep(i, 2) rep(j, 100010) L[i][j] = INF;

	dfs(0, 1, 0);

	dfs(1, N, 0);

	int Fennec = 0;

	int Snuke = 0;

	REP(i, 1, N) {

		if (L[0][i] <= L[1][i]) Fennec++;

		else Snuke++;

	}

	if (Fennec > Snuke) cout << "Fennec" << endl;

	else cout << "Snuke" << endl;



    return 0;

}


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

using namespace std;

#define ll long long int

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

#define rrep(i,n) for( int i = n; i >= 0; i-- )

#define REP(i,s,t) for( int i = s; i <= t; i++ )

#define RREP(i,s,t) for( int i = s; i >= t; i-- )

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define INF 2000000000

#define mod 1000000007

#define INF2 1000000000000000000



vector<int> G[100010];



int d[100010][2];



void dfs(int x, int k, int p = -1, int depth = 0) {

    d[x][k] = depth;

    for(auto to: G[x]) {

        if (to == p) continue;

        dfs(to, k, x, depth + 1);

    }

}



int main(void)

{

    cin.tie(0);

    ios::sync_with_stdio(false);

    int N; cin >> N;

    rep(i, N - 1) {

        int s, t;

        cin >> s >> t;

        s--; t--;

        G[s].push_back(t);

        G[t].push_back(s);

    }

    dfs(0, 0);

    dfs(N - 1, 1);

    int cnt1 = 0, cnt2 = 0;

    rep(i, N) {

        if (d[i][0] <= d[i][1]) cnt1++;

        else cnt2++;

    }

    if(cnt1 > cnt2) {

        cout << "Fennec" << endl;

    } else {

        cout << "Snuke" << endl;

    }

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





    return 0;

}


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

using namespace std;

int main()

{

    string x;

    cin >> x;

    int sz = x . size() , s = 0;

    for (int i = 0; i < x . size();)

    {

        if (x[i] == 'S')

        {

            s ++;

            i ++;

        }

        if (x[i] == 'T')

        {

            while (s)

            {

                if (x [i] == 'T')

                {

                    sz -= 2;

                }

                else

                {

                    break;

                }

                s --;

                i ++;

            }

        }

        if (x[i] == 'T' && s == 0)

        {

            i ++;

        }

    }

    cout << sz;

}

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



const int maxn=2e5;

char s[maxn],sk[maxn],tmp;

int cnt=0;



int main(){

	

	scanf("%s",s);

	

	for(int i=0;s[i]!='\0';i++){

		

		if(!cnt){

			sk[cnt]=s[i];

			cnt++;

		}

		else if(s[i]=='T' && sk[cnt-1]=='S'){

			cnt--;

		}

		else{

			sk[cnt]=s[i];

			cnt++;

		}

		

	}

	

	printf("%d\n",cnt);

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
/*  ***  In The Name of God ... ***  */

#include <bits/stdc++.h>



using namespace std ;

 

typedef long long ll ;

typedef long double ld ;





#define int long long

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



template<typename T> inline bool smin(T &a, const T &b){ return b < a ? a = b,1:0;}

template<typename T> inline bool smax(T &a, const T &b){ return a < b ? a = b,1:0;}



string s ;

int n ;

vector < int > all ; 



int32_t main()                     

{

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

	cin >> s ;

	n = ( int ) s . size ( ) ;

	all . push_back ( 1 ) ;

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

		if ( s [ i ] == s [ i - 1 ] )

			all . back ( ) ++ ;

		else

			all . push_back ( 1 ) ; 

	}

	if ( s [ 0 ] == 'T' ) {

		int res = 0 ; 

		for ( int i = 1 ; i + 1 < ( int ) all . size ( ) ; i += 2 ) {

			if ( all [ i ] < all [ i + 1 ] ) {

				res += all [ i ] ; 

			}

			else {

				res += all [ i + 1 ] ;

				if ( i + 2 < ( int ) all . size ( ) )

					all [ i + 2 ] += all [ i ] - all [ i + 1 ] ; 

			}

		}

		res <<= 1 ;

		cout << n - res << endl ; 

	}

	else {

		int res = 0 ;

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

			if ( all [ i ] < all [ i + 1 ] ) {

					res += all [ i ] ; 

			}

			else {

				res += all [ i + 1 ] ;

				if ( i + 2 < ( int ) all . size ( ) )

					all [ i + 2 ] += all [ i ] - all [ i + 1 ] ; 

			}

		}

		cout << n - 2 * res << endl ; 

	}

}


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



const int maxn=2e5;

char s[maxn],sk[maxn],tmp;

int cnt=0;



int main(){

	

	scanf("%s",s);

	

	for(int i=0;s[i]!='\0';i++){

		

		if(!cnt){

			sk[cnt]=s[i];

			cnt++;

		}

		else if(s[i]=='T' && sk[cnt-1]=='S'){

			cnt--;

		}

		else{

			sk[cnt]=s[i];

			cnt++;

		}

		

	}

	

	printf("%d\n",cnt);

	

	return 0;

}

// Fastest known solution for this problem: