Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
#Python
import sys

N=input()
a=[[] for i in range(N+1)]

for i in range(N-1):
    u,v=list(map(int,raw_input().split()))
    a[u].append(v)
    a[v].append(u)

#print a

#初期化
kyori=(N+1)*[0]

sys.setrecursionlimit(1000000)
#深さ優先探索
def dfs(Graph, Start, Visited=None):
	if (Visited==None):  Visited = [] #開始点のときに探索済みリストをつくる
	Visited.append(Start)  #現在の頂点を探索済みリストに加える
	#print(Start, "\n", Visited)  #現在の頂点と探索済みリストを表示
	for Next in Graph[Start]:  #次に探索する頂点の候補
		#print "Next::"+str(Next)
		if ( Next in Visited ):  continue  #訪問済みリストにある頂点は飛ばす
		kyori[Next]=kyori[Start]+1
		dfs(Graph, Next, Visited)  #再帰
	return kyori


kyori_from_start=dfs(a,1)


kyori=(N+1)*[0]
dfs(a,N)




f_p=0
s_p=0
for k in range(1,N+1):
	if kyori_from_start[k]<=kyori[k]:
		f_p+=1
	else:
		s_p+=1

#print f_p
#print s_p

if f_p>s_p:
	print 'Fennec'
else:
	print 'Snuke'


Fixed submission:
# -*- coding: utf-8 -*-
#Python
import sys

N=input()
adj=[[] for i in range(N+1)]

#隣接リスト
for i in range(N-1):
    x,y=list(map(int,raw_input().split()))
    adj[x].append(y)
    adj[y].append(x)

#print adj

#訪問判別フラグ
F=(N+1)*[0]

#Stack
S=[]

#距離
dist=(N+1)*[0]


#先頭から深さ優先探索
S.append(1)
while len(S) != 0:
	#print S
	v=S.pop()
	#print v
	
	if F[v]==0:
		F[v]=1
		#print F
		for u in adj[v]:
			#print "u::"+str(u)
			if F[u]==0:
				S.append(u)
				dist[u]=dist[v]+1
				#print S

#print dist



#訪問判別フラグ
F=(N+1)*[0]

#Stack
S=[]

#距離
dist2=(N+1)*[0]

#最後から深さ優先探索
S.append(N)
while len(S) != 0:
	#print S
	v=S.pop()
	#print v
	
	if F[v]==0:
		F[v]=1
		#print F
		for u in adj[v]:
			#print "u::"+str(u)
			if F[u]==0:
				S.append(u)
				dist2[u]=dist2[v]+1
				#print S

#print dist2



f_p=0
s_p=0
for k in range(1,N+1):
	if dist[k]<=dist2[k]:
		f_p+=1
	else:
		s_p+=1


if f_p>s_p:
	print 'Fennec'
else:
	print 'Snuke'

Buggy python submission (verdict: Time Limit Exceeded):
#Python

N = input()
#print N

a = [[0 for j in range(N+1)] for i in range(N+1)]

for i in range(N-1):
	l=map(int, raw_input().split())
	#print l[0]
	#print l[1]
	a[l[0]][l[1]]=1
	a[l[1]][l[0]]=1
#print a


v=(N+1)*[0]
kyori=(N+1)*[0]


def visit(i):
	v[i]=1
	#print v

	for j in range(1,N+1):

		#print "*i::"+str(i)+" "+"j::"+str(j)
		if a[i][j] == 1 and v[j] == 0:
			#print str(i)+"==>"+str(j)

			kyori[j]=kyori[i]+1

			#print "dist::"+str(dist)
			visit(j)


visit(1)
kyori_from_start=kyori
#print kyori_from_start


#Initialize
v=(N+1)*[0]
kyori=(N+1)*[0]


visit(N)
#print kyori

f_p=0
s_p=0
for k in range(1,N+1):
	if kyori_from_start[k]<=kyori[k]:
		f_p+=1
	else:
		s_p+=1

#print f_p
#print s_p

if f_p>s_p:
	print 'Fennec'
else:
	print 'Snuke'

Fixed submission:
# -*- coding: utf-8 -*-
#Python
import sys

N=input()
adj=[[] for i in range(N+1)]

#隣接リスト
for i in range(N-1):
    x,y=list(map(int,raw_input().split()))
    adj[x].append(y)
    adj[y].append(x)

#print adj

#訪問判別フラグ
F=(N+1)*[0]

#Stack
S=[]

#距離
dist=(N+1)*[0]


#先頭から深さ優先探索
S.append(1)
while len(S) != 0:
	#print S
	v=S.pop()
	#print v
	
	if F[v]==0:
		F[v]=1
		#print F
		for u in adj[v]:
			#print "u::"+str(u)
			if F[u]==0:
				S.append(u)
				dist[u]=dist[v]+1
				#print S

#print dist



#訪問判別フラグ
F=(N+1)*[0]

#Stack
S=[]

#距離
dist2=(N+1)*[0]

#最後から深さ優先探索
S.append(N)
while len(S) != 0:
	#print S
	v=S.pop()
	#print v
	
	if F[v]==0:
		F[v]=1
		#print F
		for u in adj[v]:
			#print "u::"+str(u)
			if F[u]==0:
				S.append(u)
				dist2[u]=dist2[v]+1
				#print S

#print dist2



f_p=0
s_p=0
for k in range(1,N+1):
	if dist[k]<=dist2[k]:
		f_p+=1
	else:
		s_p+=1


if f_p>s_p:
	print 'Fennec'
else:
	print 'Snuke'