Fennec and Snuke are playing a board game.
On the board, there are N cells numbered 1 through N, and N-1 roads, each connecting two cells. Cell a_i is adjacent to Cell b_i through the i-th road. Every cell can be reached from every other cell by repeatedly traveling to an adjacent cell. In terms of graph theory, the graph formed by the cells and the roads is a tree.
Initially, Cell 1 is painted black, and Cell N is painted white. The other cells are not yet colored.
Fennec (who goes first) and Snuke (who goes second) alternately paint an uncolored cell.
More specifically, each player performs the following action in her/his turn:
 - Fennec: selects an uncolored cell that is adjacent to a black cell, and paints it black.
 - Snuke: selects an uncolored cell that is adjacent to a white cell, and paints it white.
A player loses when she/he cannot paint a cell. Determine the winner of the game when Fennec and Snuke play optimally.

-----Constraints-----
 - 2 \leq N \leq 10^5
 - 1 \leq a_i, b_i \leq N
 - The given graph is a tree.

-----Input-----
Input is given from Standard Input in the following format:
N
a_1 b_1
:
a_{N-1} b_{N-1}

-----Output-----
If Fennec wins, print Fennec; if Snuke wins, print Snuke.

-----Sample Input-----
7
3 6
1 2
3 1
7 4
5 7
1 4

-----Sample Output-----
Fennec

For example, if Fennec first paints Cell 2 black, she will win regardless of Snuke's moves.

Difficulty: competition

Starter code:

Solutions:
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(10 ** 6)

def main():
    n = int(input())
    adj_list = [[] for i in range(n)]
    for i in range(n - 1):
        a1, b1 = list(map(int, sys.stdin.readline().split()))
        adj_list[a1 - 1].append(b1 - 1)
        adj_list[b1 - 1].append(a1 - 1)
    path = list(reversed(dfs(0, -1, adj_list, n)))
    assert len(path) >= 2
    fpath = len(path) - len(path) // 2
    cut = set(path[fpath - 1:fpath + 1])
    f = dfs2(0, -1, adj_list, n, cut)
    s = dfs2(n - 1, -1, adj_list, n, cut)
    assert f + s == n
    print(("Fennec" if f > s else "Snuke"))

def dfs(now, prev, adj_list, n):
    if now == n - 1:
        return [now]
    for next in adj_list[now]:
        if next == prev:
            continue
        p = dfs(next, now, adj_list, n)
        if p is not None:
            p.append(now)
            return p

def dfs2(now, prev, adj_list, n, cut):
    size = 1
    for next in adj_list[now]:
        if next == prev:
            continue
        if {now, next} == cut:
            continue
        s = dfs2(next, now, adj_list, n, cut)
        size += s
    return size

def __starting_point():
    main()

__starting_point()

N=int(input())
from collections import defaultdict,deque
branch=defaultdict(set)
for i in range(N-1):
    a,b=map(int,input().split())
    a-=1
    b-=1
    branch[a]|={b}
    branch[b]|={a}
check={0}
bef=[-2]*N
bef[0]=-1
dist=[float('inf')]*N
dist[0]=0
while len(check)>0:
    now=check.pop()
    for nex in branch[now]:
        if bef[nex]==-2:
            bef[nex]=now
            check|={nex}
            dist[nex]=dist[now]+1
NG=set()
OK={0}
now=N-1
checked={0}
for i in range((1+dist[N-1])//2):
    NG|={now}
    now=bef[now]
checked|=NG
for i in range(N):
    if i in checked:
        continue
    else:
        visited={i}
        now=i
        while True:
            now=bef[now]
            visited|={now}
            if now in NG:
                NG|=visited
                checked|=visited
                break
            elif now in OK:
                OK|=visited
                checked|=visited
                break
if len(OK)>N//2:
    print("Fennec")
else:
    print("Snuke")

import sys
sys.setrecursionlimit(100000)

N = int(input())
G = [[] for i in range(N)]
for i in range(N-1):
    a, b = (int(i) for i in input().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)

prev = [-1]*N
def DFS(start):
    res = 0
    for u in G[start]:
        if u != prev[start]:
            prev[u] = start
            res += DFS(u)
    return res+1

DFS(0)
start = N-1
path = [N-1]
while True:
    path.append(prev[start])
    start = prev[start]
    if start == 0:
        break
path.reverse()
num = len(path)
c, d = (path[(num+1)//2-1], path[(num+1)//2])
G[c].remove(d)
G[d].remove(c)
prev = [-1]*N
DFS0 = DFS(0)
prev = [-1]*N
if DFS0 > DFS(N-1):
    print("Fennec")
else:
    print("Snuke")

#!/usr/bin/env python3
import sys
from collections import deque


inf = float('inf')

def solve(N: int, a: "List[int]", b: "List[int]"):
    adj = [set() for _ in range(N)]
    for u, v in zip(a, b):
        adj[u].add(v)
        adj[v].add(u)
    
    dist_F = [inf for _ in range(N)]
    dist_F[0] = 0
    dist_S = [inf for _ in range(N)]
    dist_S[N-1] = 0

    Q = deque([(0, 0)], N)
    while len(Q) > 0:
        du, u = Q.pop()
        for v in adj[u]:
            if dist_F[v] < inf:
                continue
            dist_F[v] = du + 1
            Q.append((du+1, v))
    

    Q = deque([(0, N-1)], N)
    while len(Q) > 0:
        du, u = Q.pop()
        for v in adj[u]:
            if dist_S[v] < inf:
                continue
            dist_S[v] = du + 1
            Q.append((du+1, v))

    c_S = 0
    c_F = 0

    for df, ds in zip(dist_F, dist_S):
        if df <= ds:
            c_F += 1
        else:
            c_S += 1

    if c_F <= c_S:
        print('Snuke')
    else:
        print('Fennec')    

    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    a = [int()] * (N-1)  # type: "List[int]" 
    b = [int()] * (N-1)  # type: "List[int]" 
    for i in range(N-1):
        a[i] = int(next(tokens)) - 1
        b[i] = int(next(tokens)) - 1
    solve(N, a, b)

def __starting_point():
    main()

__starting_point()

from heapq import heappop, heappush

N = int(input())
L = [[] for i in range(N + 1)]
Fd = [float("inf") for i in range(N + 1)]
Sd = [float("inf") for i in range(N + 1)]
Fd[1] = 0
Sd[N] = 0

for i in range(N - 1):
    a, b = list(map(int, input().split()))
    L[a].append(b)
    L[b].append(a)

Q = []
heappush(Q, 1)
while Q:
    n = heappop(Q)
    d = Fd[n]
    for x in L[n]:
        if Fd[x] == float("inf"):
            Fd[x] = d + 1
            heappush(Q, x)

Q = []
heappush(Q, N)
while Q:
    n = heappop(Q)
    d = Sd[n]
    for x in L[n]:
        if Sd[x] == float("inf"):
            Sd[x] = d + 1
            heappush(Q, x)

f = 0
s = 0
for i in range(1, N + 1):
    if Fd[i] <= Sd[i]:
        f += 1
    else:
        s += 1

if f > s:
    print("Fennec")
else:
    print("Snuke")

from scipy.sparse import*
n,*a=map(int,open(0).read().split())
c=[1]*~-n
print('FSennunkeec'[sum(g>h for g,h in zip(*csgraph.dijkstra(csr_matrix((c,(a[::2],a[1::2])),[n+1]*2),0,[1,n])))*2>=n::2])

from collections import deque
n = int(input())
board = [0]*n
edge = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
q = deque()
q.append((0,1))
q.append((-1,-1))
while q:
    from_, color = q.popleft()
    if board[from_] != 0:
        continue
    board[from_] = color
    for i in edge[from_]:
        q.append((i,color))
if sum(board) > 0:
    print("Fennec")
else:
    print("Snuke")

import sys

def main():
    sys.setrecursionlimit(1000000) # recursion limit hack
    buf = input()
    N = int(buf)
    a = []
    b = []
    for i in range(N-1):
        buf = input()
        buflist = buf.split()
        a.append(int(buflist[0]) - 1)
        b.append(int(buflist[1]) - 1)
    graph = []
    for i in range(N):
        graph.append([])
    for i in range(N-1):
        graph[a[i]].append(b[i])
        graph[b[i]].append(a[i])
    path = find_path(graph, 0, N-1, [])
    split_point = (len(path) + 1) // 2
    fennec_base = path[0:split_point]
    snuke_base = path[split_point:len(path)]
    fennec_vertex_count = len(fennec_base)
    snuke_vertex_count = len(snuke_base)
    for i, v in enumerate(fennec_base):
        for j in graph[v]:
            if i != 0:
                if j == fennec_base[i-1]:
                    continue
            if i != len(fennec_base) - 1:
                if j == fennec_base[i+1]:
                    continue
            else:
                if j == snuke_base[0]:
                    continue
            fennec_vertex_count += get_vertex_count(graph, v, j)
    for i, v in enumerate(snuke_base):
        for j in graph[v]:
            if i != 0:
                if j == snuke_base[i-1]:
                    continue
            else:
                if j == fennec_base[-1]:
                    continue
            if i != len(snuke_base) - 1:
                if j == snuke_base[i+1]:
                    continue
            snuke_vertex_count += get_vertex_count(graph, v, j)
    if fennec_vertex_count > snuke_vertex_count:
        print("Fennec")
    else:
        print("Snuke")

def find_path(graph, current, target, path):
    path.append(current)
    if current == target:
        return path
    for i in graph[current]:
        if len(path) >= 2:
            if i == path[-2]:
                continue
        result = find_path(graph, i, target, path)
        if result:
            return path
    path.pop()
    return None

def get_vertex_count(graph, base, next):
    count = 1
    for i in graph[next]:
        if i == base:
            continue
        count += get_vertex_count(graph, next, i)
    return count

def __starting_point():
    main()

__starting_point()

import math
import sys
sys.setrecursionlimit(1000000)
N = int(input())
graph = {}
SCORE = 0
def dfs(visited,v,depth):
    visited[v] = depth
    for next_v in graph[v]:
        if  visited[next_v]  == -1 :
            dfs(visited,next_v,depth + 1)




for _ in range(N-1):
    a,b = list(map(int,input().split()))
    if a not in graph:
        graph[a] = [b]
    else:
        graph[a].append(b)

    if b not in graph:
        graph[b] = [a]
    else:
        graph[b].append(a)

vF = [-1] * (N + 1)
vF[1] = 0
dfs(vF,1,0)
# print(vF)

vS = [-1] * (N + 1)
vS[N] = 0

dfs(vS,N,0)
# print(vS)

fc = 0
sc = 0

for f,s in zip(vF[1:N + 1],vS[1:N + 1]):
    if f <= s:
        fc += 1
    else:
        sc += 1

# print(fc,sc)
if fc > sc:
    print("Fennec")
else:
    print("Snuke")


from sys import setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import *
from bisect import *

def read():
  return int(input())
 
def reads():
  return [int(x) for x in input().split()]

setrecursionlimit(1 << 30)

N = read()
edges = [[] for _ in range(N)]
for _ in range(N-1):
  a, b = reads()
  a, b = a-1, b-1
  edges[a].append(b)
  edges[b].append(a)

def dist(u, d):
  for v in edges[u]:
    if d[v] >= 0:
      continue
    d[v] = d[u] + 1
    dist(v, d)
  return d

distf = dist(0, [0]+[-1]*(N-1))
dists = dist(N-1, [-1]*(N-1)+[0])

numf = sum(distf[i] <= dists[i] for i in range(N))
nums = N - numf

if numf > nums:
  print("Fennec")
else:
  print("Snuke")

n = int(input())
edges = [[] for _ in range(n)]
 
for _ in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edges[a].append(b)
    edges[b].append(a)
dp = [0]*n
dp[0] =1
fp = [0]*n
fp[n-1] =1
def bfs(u):
    q = []
    q.append(u)
    while q:
        p = q.pop()
        for i in edges[p]:
            if dp[i] ==0 :
                q.append(i)
                dp[i]+=dp[p]+1
def ffs(u):
    q = []
    q.append(u)
    while q:
        p = q.pop()
        for i in edges[p]:
            if fp[i] ==0 :
                q.append(i)
                fp[i]+=fp[p]+1
bfs(0)
ffs(n-1)
c = 0
for i in range(n):
    if dp[i] <= fp[i]:
        c += 1
if 2*c > n:
    print("Fennec")
else:
    print("Snuke")

import sys
from collections import deque
readline = sys.stdin.readline

def main():
    INF = float('inf')

    N = int(readline())
    conn = [[] for _ in range(N)]
    for _ in range(N - 1):
        a, b = list(map(int, readline().split()))
        a -= 1; b -= 1
        conn[a].append(b)
        conn[b].append(a)

    dist = [INF]*N
    prev = [-1]*N
    dist[0] = 0; q = deque([0])
    while q:
        x = q.popleft()
        for y in conn[x]:
            if dist[y] == INF:
                dist[y] = dist[x] + 1
                prev[y] = x
                q.append(y)

    path = deque([])
    t = N - 1
    while t >= 0:
        path.appendleft(t)
        t = prev[t]

    a, b = path[dist[-1] // 2], path[dist[-1] // 2 + 1]
    conn[a].remove(b); conn[b].remove(a)

    blacks = 0
    visited_b = [False]*N
    q_b = deque([0]); visited_b[0] = True
    while q_b:
        x = q_b.popleft()
        blacks += 1
        for y in conn[x]:
            if not visited_b[y]:
                visited_b[y] = True
                q_b.append(y)

    whites = 0
    visited_w = [False]*N
    q_w = deque([N - 1]); visited_w[N - 1] = True
    while q_w:
        x = q_w.popleft()
        whites += 1
        for y in conn[x]:
            if not visited_w[y]:
                visited_w[y] = True
                q_w.append(y)

    print(("Fennec" if blacks > whites else "Snuke"))

def __starting_point():
    main()

__starting_point()

import sys
sys.setrecursionlimit(10**6)
N = int(input())
I = [[] for _ in range(N)]
for _ in range(N-1):
  a, b = list(map(int, input().split()))
  I[a-1].append(b-1)
  I[b-1].append(a-1)
  
def path(s,t,pth,visited): #sからtに至るpathを求める pth = list(), visited = set()
  pth.append(s)
  if s == t:
    return (pth, True)
  visited.add(s)
  flag = False
  for q in I[s]:
    if q not in visited:
      pth, flag = path(q,t,pth,visited)
      if flag: return (pth, True)
  pth.pop()
  return (pth,False)

def count(s,d,visited): #グラフをsを含み、dを含まない最大の連結成分に制限した時の要素数
  visited.add(s)
  for q in I[s]:
    if q not in visited and q != d:
      visited = count(q,d,visited)   
  return visited
      
pth, flag = path(0,N-1,[],set())  

if not flag: print("error")
d = pth[(len(pth)+1)//2]
n = len(count(0,d,set()))
#print(pth, flag, d)

if n > N//2:
  print("Fennec")
else:
  print("Snuke")
  

    

    
      
      
      
  



# -*- coding: utf-8 -*-

import sys


class UnionFind:
    '''
    配列を用いたUnionFind
    '''

    def __init__(self, size):
        self.table = [i for i in range(size)]

    def find(self, x):
        '''
        xのグループ番号を返す
        '''
        return self.table[x]

    def union(self, val, y):
        '''
        Fennecは0
         SnukeはN-1とすることで、O(1)にする
         '''
        self.table[y] = val

    def same(self, x, y):
        '''
        xとyが同じグループならtrue
        '''
        x1 = self.find(x)
        y1 = self.find(y)
        return x1 == y1

    def get_table(self):
        return self.table
# python template for atcoder1


sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N = int(input())
adj = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = list(map(int, input().split()))
    adj[a-1].append(b-1)
    adj[b-1].append(a-1)

Un = UnionFind(N)
S = [N-1]
F = [0]
S_or = N-1
F_or = 0


def oneStep(turn):
    ret = []
    if turn == 1:
        while S:
            c = S.pop(0)
            for i in adj[c]:
                if not Un.same(S_or, i) and not Un.same(F_or, i):
                    Un.union(S_or, i)
                    ret.append(i)
    else:
        while F:
            c = F.pop(0)
            for i in adj[c]:
                if not Un.same(S_or, i) and not Un.same(F_or, i):
                    Un.union(F_or, i)
                    ret.append(i)
    return ret


turn = 0
while S or F:
    if turn == 1:
        if len(S) != 0:
            S = oneStep(turn)
        turn = 0
    else:
        if len(F) != 0:
            F = oneStep(turn)
        turn = 1

cntF = Un.get_table().count(0)
cntS = Un.get_table().count(N-1)
if cntF > cntS:
    ans = "Fennec"
else:
    ans = "Snuke"
print(ans)


from collections import defaultdict
from heapq import heappop, heappush


class Graph(object):
    """
    隣接リストによる有向グラフ
    """

    def __init__(self):
        self.graph = defaultdict(list)

    def __len__(self):
        return len(self.graph)

    def add_edge(self, src, dst, weight=1):
        self.graph[src].append((dst, weight))

    def get_nodes(self):
        return self.graph.keys()


class Dijkstra(object):
    """
    ダイクストラ法（二分ヒープ）による最短経路探索
    計算量: O((E+V)logV)
    """

    def __init__(self, graph, start):
        self.g = graph.graph

        # startノードからの最短距離
        # startノードは0, それ以外は無限大で初期化
        self.dist = defaultdict(lambda: float('inf'))
        self.dist[start] = 0

        # 最短経路での1つ前のノード
        self.prev = defaultdict(lambda: None)

        # startノードをキューに入れる
        self.Q = []
        heappush(self.Q, (self.dist[start], start))

        while self.Q:
            # 優先度（距離）が最小であるキューを取り出す
            dist_u, u = heappop(self.Q)
            if self.dist[u] < dist_u:
                continue
            for v, weight in self.g[u]:
                alt = dist_u + weight
                if self.dist[v] > alt:
                    self.dist[v] = alt
                    self.prev[v] = u
                    heappush(self.Q, (alt, v))

    def shortest_distance(self, goal):
        """
        startノードからgoalノードまでの最短距離
        """
        return self.dist[goal]

    def shortest_path(self, goal):
        """
        startノードからgoalノードまでの最短経路
        """
        path = []
        node = goal
        while node is not None:
            path.append(node)
            node = self.prev[node]
        return path[::-1]


g = Graph()
#N, M = [int(i) for i in input().split()]
N = int(input())

for i in range(N-1):
    u, v = [int(i) for i in input().split()]
    g.add_edge(u-1, v-1, 1)
    g.add_edge(v-1, u-1, 1)

d1 = Dijkstra(g, 0)
d2 = Dijkstra(g, N-1)

ans = 0

#print(d1.dist)
#print(d2.dist)

for i in range(N):
    if d1.dist[i] <= d2.dist[i]:
        ans += 1

if ans > N - ans:
    print("Fennec")
else:
    print("Snuke")

from collections import deque


def nearlist(N, LIST):
    NEAR = [set() for _ in range(N)]
    for a, b in LIST:
        NEAR[a - 1].add(b - 1)
        NEAR[b - 1].add(a - 1)
    return NEAR


def bfs(S):
    dist, flag = [-1] * n, [0] * n
    dist[S], flag[S] = 0, 1
    que = deque([S])

    while que:
        q = que.popleft()
        for i in near[q]:
            if flag[i]:
                continue
            dist[i] = dist[q] + 1
            flag[i] = 1
            que.append(i)
    return dist


n = int(input())
ab = [list(map(int, input().split())) for _ in range(n - 1)]

near = nearlist(n, ab)
fennec, snuke = bfs(0), bfs(n - 1)
ans = sum(fennec[i] <= snuke[i] for i in range(n))
print(('Fennec' if ans * 2 > n else 'Snuke'))



import sys

p = []
path = [ 0 for i in range(10**5+1)]
def main():

    sys.setrecursionlimit(1000000)

    N = int(input())

    e = [ [] for i in range(N)]
    for i in range(N-1):
        a,b = list(map(int,input().split()))
        a-=1
        b-=1
        e[a].append(b)
        e[b].append(a)

    col = [ -1 for i in range(N)]
    col[0] = 0
    
    def dfs(n,c):
        nonlocal p
        if n == N - 1:
            p = path
        path[c] = n
        for v in e[n]:
            if col[v] == -1:
                col[v] = c + 1
                dfs(v,c+1)
                if p:
                    return
    dfs(0,0)

    t = col[N-1] + 1
    if t % 2 ==0:
        sn = p[t//2]
    else:
        sn = p[t//2+1]


    colfn = [ -1 for i in range(N)]
    colfn[0] = 0
    def dfs2(n,c):

        for v in e[n]:
            if v == sn:
                continue
            elif colfn[v] == -1:
                colfn[v] = c + 1
                dfs2(v,c+1)

    dfs2(0,0)

    fennec = -1
    for i in range(N):
        if colfn[i] != -1:
            fennec += 1

    snuke = N - fennec - 2
    if fennec > snuke:
        print("Fennec")
    else:
        print("Snuke")



def __starting_point():
    main()


__starting_point()

n = int(input())
ab = [list(map(int,input().split())) for i in range(n-1)]
graph = [[] for i in range(n+1)]
visited = [0 for i in range(n+1)]
root = 1
stack = [root]
for a,b in ab:
  graph[a].append(b)
  graph[b].append(a)
visited[0] = -1
visited[root] = 1
while stack:
  x = stack.pop()
  if x == n:
    break
  for y in graph[x]:
    if visited[y] == 0:
      stack.append(y)
      visited[y] = visited[x]+1
dist = visited[n]-1
way = n
while True:
  if visited[way] == dist//2+2:
    border = way
    break
  for y in graph[way]:
    if visited[y] == visited[way]-1:
      way = y
stack = [1]
visited = [0 for i in range(n+1)]
visited[border] = 1
fen = 0
while stack:
  x = stack.pop()
  fen += 1
  visited[x] = 1
  for y in graph[x]:
    if visited[y] == 0:
      stack.append(y)
snk = n-fen
if fen > snk:
  print("Fennec")
else:
  print("Snuke")

n = int(input())
edges = [[] for _ in range(n)]
 
for _ in range(n-1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edges[a].append(b)
    edges[b].append(a)
 
def bfs(v):
    q = []
    depth = [n]*n
    q.append(v)
    depth[v] = 0
    i = 0
    while i < len(q):
        x = q[i]
        d = depth[x]
        for e in edges[x]:
            if depth[e] == n:
                depth[e] = d+1
                q.append(e)
        i += 1
    return depth
 
d1 = bfs(0)
d2 = bfs(n-1)
 
c = 0
for i in range(n):
    if d1[i] <= d2[i]:
        c += 1
if 2*c > n:
    print("Fennec")
else:
    print("Snuke")

from collections import deque
N = int(input())
edge = [[] for _ in range(N)]
for _ in range(N - 1):
    a, b = map(int, input().split())
    edge[a - 1].append(b - 1)
    edge[b - 1].append(a - 1)
d = [[-1] * N for _ in range(2)]
for i in range(2):
    d[i][i * (N - 1)] = 0
    q = deque([i * (N - 1)])
    while len(q) > 0:
        u = q.popleft()
        for v in edge[u]:
            if d[i][v] > -1:
                continue
            d[i][v] = d[i][u] + 1
            q.append(v)
S = 0
F = 0
for i in range(N):
    if d[0][i] > d[1][i]:
        S += 1
    else:
        F += 1
if F > S:
    print("Fennec")
else:
    print("Snuke")

import heapq
import sys

input = sys.stdin.readline

def dijlstra_heap(N,s,edge):
    d = [float('inf')] * N
    used = [True] * N
    d[s] = 0
    edgelist = []
    for a, b in edge[s]:
        heapq.heappush(edgelist, a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        if not used[minedge%(10**6)]:
            continue
        v = minedge % (10 ** 6)
        d[v] = minedge // (10 ** 6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d

def main():
    N = int(input())
    edge = [[] for i in range(N)]
    for i in range(N-1):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        edge[a].append([1,b])
        edge[b].append([1,a])
    d0 = dijlstra_heap(N,0,edge)
    dn = dijlstra_heap(N,N-1,edge)

    f_cnt = 0
    s_cnt = 0
    for i in range(N):
        if d0[i] <= dn[i]:
            f_cnt += 1
        else:
            s_cnt += 1

    if f_cnt > s_cnt:
        print('Fennec')
    else:
        print('Snuke')


def __starting_point():
    main()
__starting_point()

import sys
sys.setrecursionlimit(2*10**5)

# 入力
N = int(input())
a, b = (
    list(zip(*(list(map(int, input().split())) for _ in range(N - 1)))) if N - 1 else
    ((), ())
)

G = [set() for _ in range(N + 1)]
for x, y in zip(a, b):
    G[x].add(y)
    G[y].add(x)


dp = [0 for _ in range(N + 1)]
dp[1] = 1


def f(i):
    for j in G[i]:
        if dp[j] == 0:
            dp[j] = i
            f(j)


f(1)
p = []
i = N
while i != 1:
    p.append(i)
    i = dp[i]
p.append(1)
dp2 = [0 for _ in range(N + 1)]
for j in range(len(p)):
    if dp2[p[-(j + 1)]] == 0:
        dp2[p[-(j + 1)]] = 1
    if dp2[p[j]] == 0:
        dp2[p[j]] = -1
dp3 = [0 for _ in range(N + 1)]
dp3[1] = 1


def g(i):
    for j in G[i]:
        if dp3[j] == 0 and dp2[j] != -1:
            dp3[j] = 1
            g(j)


g(1)
ans = (
    'Fennec' if dp3.count(1) > N // 2 else
    'Snuke'
)
print(ans)



import sys
sys.setrecursionlimit(1000000)

N = int(input())

e = [ [] for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    a-=1
    b-=1
    e[a].append(b)
    e[b].append(a)

col = [ -1 for i in range(N)]
col[0] = 0

p = []
path = [ 0 for i in range(10**5+1)]
def dfs(n,c):
    nonlocal p
    if n == N - 1:
        p = path
    path[c] = n
    for v in e[n]:
        if col[v] == -1:
            col[v] = c + 1
            dfs(v,c+1)
            if p:
                return
dfs(0,0)

t = col[N-1] + 1
if t % 2 ==0:
    sn = p[t//2]
else:
    sn = p[t//2+1]


colfn = [ -1 for i in range(N)]
colfn[0] = 0
def dfs2(n,c):

    for v in e[n]:
        if v == sn:
            continue
        elif colfn[v] == -1:
            colfn[v] = c + 1
            dfs2(v,c+1)

dfs2(0,0)

fennec = -1
for i in range(N):
    if colfn[i] != -1:
        fennec += 1

snuke = N - fennec - 2
if fennec > snuke:
    print("Fennec")
else:
    print("Snuke")

n=int(input())
node=[[]for _ in range(n)]
for _ in range(n-1):
	a,b=map(int,input().split())
	node[a-1].append(b-1)
	node[b-1].append(a-1)
visited=[False]*n
def dfs(i):
	dis=[-1]*n
	dis[i]=0
	stack=[i]
	while stack:
		p=stack.pop()
		for x in node[p]:
			if dis[x]==-1:
				dis[x]=dis[p]+1
				stack.append(x)
	return dis
d0,dn=dfs(0),dfs(n-1)
cnt=0
for i in range(n):
	if d0[i]>dn[i]:
		cnt+=1
if cnt>=n/2:
	print("Snuke")
else:
	print("Fennec")

from heapq import heappush, heappop
from collections import defaultdict

def dijkstra(V, E, s):
    '''
    Input:
        V = list(range(N))
        E = defaultdict(dict)
        s (in V) : start vertex
    Output:
        dist: the list of the minimum cost from s to arbitrary vertex v in the given graph
    '''
    INF = float('inf')
    dist = {v: INF for v in V}
    heap = []
    dist[s] = 0; rem = len(V);
    heappush(heap, (0, s))
    while heap and rem:
        d, v = heappop(heap)
        # don't need to check when the stored value is greater than provisional distance
        if d > dist[v]: continue
        rem -= 1;
        for u, c in E[v].items():
            temp = d + c
            if temp < dist[u]:
                dist[u] = temp
                heappush(heap, (temp, u))
    return dist

N = int(input())
V = list(range(1, N+1))
E = defaultdict(dict)
for _ in range(N-1):
    a, b = map(int, input().split())
    E[a][b] = 1
    E[b][a] = 1
fen = dijkstra(V, E, 1)
sun = dijkstra(V, E, N)
black, white = 0, 0
for v in V:
    if fen[v] <= sun[v]: black += 1
    else: white += 1
print('Fennec' if black > white else 'Snuke')

from networkx import*
N,*t=open(0)
G=Graph()
for s in t:a,b=s.split();G.add_edge(a,b)
s=shortest_path_length
x=s(G,'1')
y=s(G,N[:-1])
print('FSennunkeec'[sum(x[k]>y[k]for k in x)*2>=int(N)::2])

from networkx import*
(N,),*t=map(str.split,open(0))
G=Graph()
G.add_edges_from(t)
s=shortest_path_length
x=s(G,'1')
y=s(G,N)
print('FSennunkeec'[sum(x[k]>y[k]for k in x)*2>=int(N)::2])


N=int(input())
e_list = [[] for i in range(N)]
for i in range(N-1):
    a,b=list(map(int,input().split()))
    a,b=a-1,b-1
    e_list[a].append(b)
    e_list[b].append(a)

vi = 0 #時と場合によってここを変える
from collections import deque
Q = deque([vi])
checked_list = [False for i in range(N)]
checked_list[vi]=True
prev_list = [-1 for i in range(N)]
min_path_list = [10**27 for i in range(N)] #問題によりここを変える
min_path_list[vi] = 0
while len(Q)>0:
    v = Q.pop()
    for v1 in e_list[v]:
        if not checked_list[v1]:
            checked_list[v1]=True
            Q.appendleft(v1)
            prev_list[v1]=v
            min_path_list[v1]=min(min_path_list[v1],min_path_list[v]+1) #問題によりここを変える

path = [N-1]
v=N-1
while prev_list[v]!=-1:
    path.append(prev_list[v])
    v=prev_list[v]

a=path[(min_path_list[N-1]-1)//2]
b=path[(min_path_list[N-1]-1)//2+1]
for i in range(len(e_list[a])):
    if e_list[a][i]==b:
        break
del e_list[a][i]

for i in range(len(e_list[b])):
    if e_list[b][i]==a:
        break
del e_list[b][i]

vi = 0 #時と場合によってここを変える

Q = deque([vi])
checked_list = [False for i in range(N)]
checked_list[vi]=True
count = 1
while len(Q)>0:
    v = Q.pop()
    for v1 in e_list[v]:
        if not checked_list[v1]:
            checked_list[v1]=True
            Q.appendleft(v1)
            count+=1

if count>N-count:
    print("Fennec")
else:
    print("Snuke")

n=int(input())
tree=[[] for i in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  tree[a-1].append(b-1)
  tree[b-1].append(a-1)
def dist(k):
  l=[-1]*n
  node=[k]
  while node:
    s=node.pop()
    d=l[s]
    for t in tree[s]:
      if l[t]!=-1:
        continue
      l[t]=d+1
      node.append(t)
  return l
from_fennec=dist(0)
from_snuke=dist(n-1)
res=0
for i,j in zip(from_fennec,from_snuke):
  if i<=j:
    res+=1
  else:
    res-=1
print('Snuke' if res<=0 else 'Fennec')

import sys

p = []
path = [ 0 for i in range(10**5+1)]
def main():

    sys.setrecursionlimit(1000000)

    N = int(input())

    e = [ [] for i in range(N)]
    for i in range(N-1):
        a,b = list(map(int,input().split()))
        a-=1
        b-=1
        e[a].append(b)
        e[b].append(a)

    col = [ -1 for i in range(N)]
    col[0] = 0
    
    #def dfs(n,c,path):
    def dfs(n,c):
        nonlocal p
        #path =  path  + [n]
        #path.append(n)
        #print(path)
        if n == N - 1:
            p = path
        path[c] = n
        for v in e[n]:
            if col[v] == -1:
                col[v] = c + 1
                dfs(v,c+1)
                #dfs(v,c+1,path)
                if p:
                    return
    dfs(0,0)
    #print(p[:N+10])
    #dfs(0,0,[])

    t = col[N-1] + 1
    if t % 2 ==0:
        sn = p[t//2]
    else:
        sn = p[t//2+1]


    colfn = [ -1 for i in range(N)]
    colfn[0] = 0
    def dfs2(n,c):

        for v in e[n]:
            if v == sn:
                continue
            elif colfn[v] == -1:
                colfn[v] = c + 1
                dfs2(v,c+1)

    dfs2(0,0)

    fennec = -1
    for i in range(N):
        if colfn[i] != -1:
            fennec += 1

    snuke = N - fennec - 2
    if fennec > snuke:
        print("Fennec")
    else:
        print("Snuke")



def __starting_point():
    main()


__starting_point()

from collections import deque

N = int(input())

INF = 100001
G = [[] for i in range(N)]
dist1, dist2 = [INF for j in range(N)], [INF for k in range(N)]


def bfs(s, d):
    check, q = [0 for i in range(N)], deque()
    check[s], d[s] = 1, 0
    q.append(s)

    while len(q) != 0:
        u = q.popleft()
        for i in G[u]:
            if check[i] == 0:
                check[i], d[i] = 1, d[u] + 1
                q.append(i)
        check[u] = 2


def main():
    for i in range(N-1):
        a, b = list(map(int, input().split()))
        G[a-1].append(b-1)
        G[b-1].append(a-1)

    bfs(0, dist1)
    bfs(N-1, dist2)

    cnt_f = 0
    for i in range(N):
        if dist1[i] <= dist2[i]:
            cnt_f += 1

    if N // 2 < cnt_f:
        print("Fennec")
    else:
        print("Snuke")


def __starting_point():
    main()

__starting_point()

from scipy.sparse import*
n,*a=map(int,open(0).read().split())
print('FSennunkeec'[sum(g>h for g,h in zip(*csgraph.dijkstra(csr_matrix(([1]*~-n,(a[::2],a[1::2])),[n+1]*2),0,[1,n])))*2>=n::2])

import sys
stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x) - 1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

from collections import deque

def bfs(graph: list, start: int):
    n = len(graph)
    dist = [-1]*n

    que = deque([(start, 0)])

    while que:
        cur_node, cur_dist = que.popleft()
        dist[cur_node] = cur_dist

        for nex in graph[cur_node]:
            if dist[nex] < 0:
                dist[nex] = cur_dist + 1
                que.append((nex, cur_dist+1))

    return dist

n = ni()

graph = [[] for _ in range(n)]
for _ in range(n-1):
    x, y = li_()
    graph[x].append(y)
    graph[y].append(x)

fenec = bfs(graph, 0)
snuke = bfs(graph, n-1)

fenec_saki = 0
for d1, d2 in zip(fenec, snuke):
    if d1 <= d2:
        fenec_saki += 1
    elif d1 > d2:
        fenec_saki -= 1

if fenec_saki == 0:
    if n%2:
        print("Fennec")
    else:
        print("Snuke")

elif fenec_saki > 0:
    print("Fennec")

else:
    print("Snuke")

N = int(input())
edge = [[]*N for _ in range(N)]

for _ in range(N-1):
    go,to = map(int,input().split())
    go -= 1
    to -= 1
    edge[go].append(to)
    edge[to].append(go)
    
from collections import deque
que = deque(maxlen=N)
que.append([0,0])
dist0 = [None]*N
distn = [None]*N
while(que):
    v = que.popleft()
    c = v[0]
    d = v[1]
    for i in edge[c]:
        if dist0[i] is None:
            dist0[i] = d + 1
            que.append([i,d+1])
que.append([N-1,0])
while(que):
    v = que.popleft()
    c = v[0]
    d = v[1]
    for i in edge[c]:
        if distn[i] is None:
            distn[i] = d + 1
            que.append([i,d+1])
w = b = 0
for d1,dn in zip(dist0,distn):
    if d1<=dn:
        b += 1
    else:
        w += 1
print('Fennec' if b-w > 0 else 'Snuke')

# -*- coding: utf-8 -*-
from collections import deque
n = int(input())
edge = [[] for _ in range(n+1)]
for _ in range(n-1):
    a,b = list(map(int, input().split()))
    edge[a].append(b)
    edge[b].append(a)

inf = 10**6


fvisited = [inf for _ in range(n+1)]
fvisited[1] = 0
q = deque([1])
while len(q)>0:
    s = q.popleft()
    for e in edge[s]:
        if fvisited[e]==inf:
            fvisited[e] = fvisited[s]+1
            q.append(e)

svisited = [inf for _ in range(n+1)]
svisited[n] = 0
q = deque([n])
while len(q)>0:
    s = q.popleft()
    for e in edge[s]:
        if svisited[e]==inf:
            svisited[e] = svisited[s]+1
            q.append(e)

# print(fvisited)
# print(svisited)
fcnt = 0
scnt = 0
for i in range(1,n+1):
    if fvisited[i]<=svisited[i]:
        fcnt += 1
    else:
        scnt += 1

if fcnt>scnt:
    print("Fennec")
else:
    print("Snuke")


import sys
sys.setrecursionlimit(10**7)
n=int(input())
edge=[[] for _ in range(n)]
for i in range(n-1):
    x,y=map(int,input().split())
    edge[x-1].append(y-1)
    edge[y-1].append(x-1)
def dfs(node,dist,distl):
    distl[node]=dist
    for e in edge[node]:
        if distl[e]==-1:
            dfs(e,dist+1,distl)
dista,distb=[-1]*n,[-1]*n
dfs(0,0,dista)
dfs(n-1,0,distb)
a,b=0,0
for i in range(n):
    if dista[i]<=distb[i]:
        a+=1
    else:
        b+=1
print('Fennec' if a>b else 'Snuke')

import sys
input = sys.stdin.readline
N = int(input())
tree = [[] for i in range(N+1)]

for i in range(N-1):
    a, b = list(map(int, input().split()))
    tree[a].append(b)
    tree[b].append(a)

dist_fennec = [100001] * (N+1)
dist_snuke = [100001] * (N+1)
q = [1]
dist_fennec[1] = 0
while q:
    now = q.pop()
    for next in tree[now]:
        if dist_fennec[next] == 100001:
            dist_fennec[next] = dist_fennec[now] + 1
            q.append(next)

q = [N]
dist_snuke[N] = 0
while q:
    now = q.pop()
    for next in tree[now]:
        if dist_snuke[next] == 100001:
            dist_snuke[next] = dist_snuke[now] + 1
            q.append(next)

fennec, snuke = 0, 0
for i in range(1, N+1):
    if dist_snuke[i] >= dist_fennec[i]:
        fennec += 1
    else:
        snuke += 1

if fennec > snuke:
    print("Fennec")
else:
    print("Snuke")


from networkx import*
(N,),*t=map(str.split,open(0))
G=Graph(t)
s=shortest_path_length
x=s(G,'1')
y=s(G,N)
print('FSennunkeec'[sum(x[k]>y[k]for k in x)*2>=int(N)::2])

n = int(input())
edges = [[] for _ in range(n)]

for _ in range(n-1):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    edges[a].append(b)
    edges[b].append(a)

def bfs(v):
    q = []
    depth = [n]*n
    q.append(v)
    depth[v] = 0
    i = 0
    while i < len(q):
        x = q[i]
        d = depth[x]
        for e in edges[x]:
            if depth[e] == n:
                depth[e] = d+1
                q.append(e)
        i += 1
    return depth

d1 = bfs(0)
d2 = bfs(n-1)

c = 0
for i in range(n):
    if d1[i] <= d2[i]:
        c += 1
if 2*c > n:
    print("Fennec")
else:
    print("Snuke")


N=int(input())
edge=[list(map(int,input().split())) for i in range(N-1)]
inf=10**20
c=[[] for i in range(N)]
for i,j in edge:
    c[i-1].append(j-1)
    c[j-1].append(i-1)
d=[0]+[inf]*(N-1)
v=[0]*N
import sys
sys.setrecursionlimit(10**6)
def dfs(p,v,d):
    for n in c[p]:
        if v[n]==0:
            d[n]=min(d[n],d[p]+1)
            v[n]=1
            dfs(n,v,d)
dfs(0,v,d)
d2=[inf]*(N-1)+[0]
v=[0]*N
dfs(N-1,v,d2)
c=0
for i,j in zip(d,d2):
    c=c+1 if i<=j else c-1
print(['Snuke','Fennec'][c>0])

from collections import deque
n=int(input())
graph=[[] for i in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    a-=1;b-=1
    graph[a].append(b)
    graph[b].append(a)
distfrom1=[-1]*n
distfromn=[-1]*n
distfrom1[0]=0
distfromn[n-1]=0
d=deque([0])
while d:
    v=d.popleft()
    for i in graph[v]:
        if distfrom1[i]!=-1:continue
        distfrom1[i]=distfrom1[v]+1
        d.append(i)
d.append(n-1)
while d:
    v=d.popleft()
    for i in graph[v]:
        if distfromn[i]!=-1:continue
        distfromn[i]=distfromn[v]+1
        d.append(i)
F=0
for i in range(n):
    if distfrom1[i]<=distfromn[i]:F+=1
if F>n-F:print("Fennec")
else:print("Snuke")


#
#フェネックとすぬけさんが最短でお互いのマスへ向かう時の、ぶつかる点を求めて
#木を分割する。分割した二つのマスを数えて比較し、大きい方が勝利

import sys
sys.setrecursionlimit(1000000)

N = int(input())
e = [ [] for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    a-=1
    b-=1
    e[a].append(b)
    e[b].append(a)

#二人がぶつかる点を求める（木を分割する点を求める）
col = [ -1 for i in range(N)]
col[0] = 0
p = []
path = [ 0 for i in range(10**5+1)]
def dfs(n,c):
    nonlocal p
    if n == N - 1:
        p = path
    path[c] = n
    for v in e[n]:
        if col[v] == -1:
            col[v] = c + 1
            dfs(v,c+1)
            if p:
                return
dfs(0,0)

t = col[N-1] + 1
if t % 2 ==0:
    sn = p[t//2]
else:
    sn = p[t//2+1]


#フェネック側の木のマス数を数える
colfn = [ -1 for i in range(N)]
colfn[0] = 0
def dfs2(n,c):

    for v in e[n]:
        if v == sn:
            continue
        elif colfn[v] == -1:
            colfn[v] = c + 1
            dfs2(v,c+1)

dfs2(0,0)

fennec = -1
for i in range(N):
    if colfn[i] != -1:
        fennec += 1


#すぬけさん側は全マス数からフェネックのマスを引けば良い
snuke = N - fennec - 2

if fennec > snuke:
    print("Fennec")
else:
    print("Snuke")

#分岐は後で処理すれば良い
#それぞれ0,nに近づくのが最適
import sys
sys.setrecursionlimit(10**8)
from heapq import heappush,heappop
inf=10**10
n=int(input())
l=[[] for i in range(n+1)]
for i in range(n-1):
  a,b=map(int,input().split())
  l[a].append(b)
  l[b].append(a)
prev=[-1 for i in range(n+1)]
def dijkstra(s):
  q=[(0,s)]
  dist=[inf]*(n+1)
  dist[s]=0
  while q:
    c,v=heappop(q)
    if dist[v]<c:
      continue
    for i in l[v]:
      t=i
      cost=1
      if dist[v]+cost<dist[t]:
        dist[t]=dist[v]+cost
        prev[t]=v
        heappush(q,[dist[t],t])
  return dist
d=dijkstra(1)
p=[n]
num=n
next=[-1 for i in range(n+1)]
while num!=1:
  num1=prev[num]
  next[num1]=num
  p.append(num1)
  num=num1
countp=[0]
countf=[0]
def dfs(x,y):
  for i in l[x]:#iに分岐可能ならば
    if prev[x]!=i and next[x]!=i:
      if y==1:
        countp[0]+=1
      else:
        countf[0]+=1
      prev[i]=x
      dfs(i,y) 
p=p[::-1]
num=len(p)
num1=(num-1)//2+1
for i in range(num1):
  countp[0]+=1
  dfs(p[i],1)
for i in range(num1,num):
  countf[0]+=1
  dfs(p[i],0)
if countp[0]>countf[0]:
  print("Fennec")
else:
  print("Snuke")

from collections import deque

def dfs(graph, start):
    stack = deque()
    costs = [0] * (N+1)
    stack.append([start,0])
    costs[start] = -1
    while stack:
        a, cost = stack.popleft()
        for b in list(graph[a].keys()):
            if not costs[b]:
                stack.append([b,cost+1])
                costs[b] = cost+1
    return costs

N = int(input())
graph = {}
for i in range(N-1):
    a,b = list(map(int, input().split()))
    if a not in graph:
        graph[a] = {}
    if b not in graph:
        graph[b] = {}
    graph[a][b] = graph[b][a] = 1
f_costs = dfs(graph,1)
s_costs = dfs(graph,N)
f_cnt = 1
for i in range(2,N):
    if f_costs[i] <= s_costs[i]:
        f_cnt += 1
# print(f_costs, s_costs, f_cnt)
print(('Fennec' if f_cnt > N - f_cnt else 'Snuke'))


from collections import*
input=open(0).readline
n=int(input())
e=[[]for _ in range(n)]
for _ in range(n-1):
    a,b=map(int,input().split())
    e[a-1].append(b-1)
    e[b-1].append(a-1)
f=[0]*n
v=[1]+[0]*~-n
q=deque([(0,0)])
while q:
    t,c=q.pop()
    v[t]=1
    f[t]=c
    for i in e[t]:
        if not v[i]:
            q.append((i,c+1))
s=[0]*n
v=[0]*~-n+[1]
q=deque([(n-1,0)])
while q:
    t,c=q.pop()
    v[t]=1
    s[t]=c
    for i in e[t]:
        if not v[i]:
            q.append((i,c+1))
a=b=0
for i,j in zip(f,s):
    if i<=j:
        a+=1
    else:
        b+=1
if a>b:
    print('Fennec')
else:
    print('Snuke')

def bfs(graph,start,n,check):
    if check == False:
        arrival = [0 for i in range(n+1)]
    else:
        arrival = [0 for i in range(n+1)]
        arrival[check] = -1
    q = [start]
    arrival[start] = 1
    while len(q) != 0:
        for i in range(len(graph[q[0]])):
            if arrival[graph[q[0]][i]] == 0:
                q.append(graph[q[0]][i])
                arrival[graph[q[0]][i]] = arrival[q[0]]+1
        q.pop(0)
    return arrival

n = int(input())
graph = dict()
for i in range(1,n+1):
    graph[i] = []

for i in range(n-1):
    a,b = map(int,input().split())
    graph[a].append(b)
    graph[b].append(a)


fstart = bfs(graph,1,n,False)
sstart = bfs(graph,n,n,False)
fennec = 0
snuke = 0
for i in range(1,n+1):
    if abs(fstart[i]-fstart[1]) <= abs(sstart[i]-sstart[n]):
        fennec += 1
    else:
        snuke += 1


if fennec > snuke:
    print("Fennec")
else:
    print("Snuke")

from networkx import*
(N,),*t=[s.split()for s in open(0)]
G=Graph()
for a,b in t:G.add_edge(a,b)
s=shortest_path_length
x=s(G,'1')
y=s(G,N)
c=0
for k in y:c+=x[k]>y[k]
print('FSennunkeec'[c*2>=int(N)::2])

import sys
sys.setrecursionlimit(1000000)

N=int(input())

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

F=[10**10 for i in range(N+1)]
F[1]=0
S=[10**10 for i in range(N+1)]
S[N]=0

for i in range(N-1):
    a,b=list(map(int,input().split()))
    B[a].append(b)
    B[b].append(a)
    
#print(B)
def dfsF(f):
    for i in B[f]:
        if F[i]==10**10:
            F[i]=F[f]+1
            dfsF(i)
dfsF(1)

def dfsS(s):
    for i in B[s]:
        if S[i]==10**10:
            S[i]=S[s]+1
            dfsS(i)
dfsS(N)
#print(F)
#print(S)
Fennec=0
Snuke=0
for i in range(1,N+1):
    if F[i]<=S[i]:
        Fennec+=1
    else:
        Snuke+=1
if Fennec>Snuke:
    print("Fennec")
else:
    print("Snuke")


N=int(input())

import sys
sys.setrecursionlimit(10**5)
ab=[list(map(int, input().split())) for _ in range (N-1)]
con=[[] for _ in range(N+1)]

#print(ab)
for a,b in ab :
  con[a].append(b)
  con[b].append(a)

#black Fennec
pc=[0]*(N+1)
q=[(1,0)]
vis=[False]*(N+1)
vis[1]=True
Fcnt=N
while q:
  n,c=q.pop()
  pc[n]=c
  for ch in con[n]:
    if vis[ch]==True:
      continue
    vis[ch]=True
    q.append((ch,c+1))
    
q=[(N,0)]
vis=[False]*(N+1)
vis[N]=True
while q:
  n,c=q.pop()
  if pc[n]>c:
    Fcnt-=1
  for ch in con[n]:
    if vis[ch]==True:
      continue
    vis[ch]=True
    q.append((ch,c+1))
    
if Fcnt>N-Fcnt:
  print("Fennec")
else:
  print("Snuke")


#分岐は後で処理すれば良い
#それぞれ0,nに近づくのが最適
from heapq import heappush,heappop
inf=10**10
n=int(input())
l=[[] for i in range(n+1)]
for i in range(n-1):
  a,b=map(int,input().split())
  l[a].append(b)
  l[b].append(a)
def dijkstra(s):
  q=[(0,s)]
  dist=[inf]*(n+1)
  dist[s]=0
  while q:
    c,v=heappop(q)
    if dist[v]<c:
      continue
    for i in l[v]:
      t=i
      cost=1
      if dist[v]+cost<dist[t]:
        dist[t]=dist[v]+cost
        heappush(q,[dist[t],t])
  return dist
d1=dijkstra(1)
d2=dijkstra(n)
countp=0
counts=0
for i in range(1,n+1):
  if d1[i]>d2[i]:
    counts+=1
  else:
    countp+=1
if countp>counts:
  print("Fennec")
else:
  print("Snuke")

import sys
sys.setrecursionlimit(1000000)

N=int(input())

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

F=[10**10 for i in range(N+1)]
F[1]=0
S=[10**10 for i in range(N+1)]
S[N]=0

for i in range(N-1):
    a,b=list(map(int,input().split()))
    B[a].append(b)
    B[b].append(a)
    
#print(B)
def dfsF(f):
    for i in B[f]:
        if F[i]==10**10:
            F[i]=F[f]+1
            dfsF(i)
dfsF(1)

def dfsS(s):
    for i in B[s]:
        if S[i]==10**10:
            S[i]=S[s]+1
            dfsS(i)
dfsS(N)
#print(F)
#print(S)
Fennec=0
Snuke=0
for i in range(1,N+1):
    if F[i]<=S[i]:
        Fennec+=1
    else:
        Snuke+=1
if Fennec>Snuke:
    print("Fennec")
else:
    print("Snuke")


from collections import *
n=int(input())
ab=[[]for i in range(n)]
for i in range(n-1):
    x,y=map(int,input().split())
    ab[x-1].append(y-1)
    ab[y-1].append(x-1)
s=[float("inf")]*n
f=[float("inf")]*n
q=deque()
q.append((0,0))
while q:
    a,b=q.popleft()
    if f[a]==float("inf"):
        f[a]=b
        for j in ab[a]:
            if f[j]==float("inf"):
                q.append((j,b+1))
                
d=deque()
d.append((n-1,0))
while d:
    a,b=d.popleft()
    if s[a]==float("inf"):
        s[a]=b
        for j in ab[a]:
            if s[j]==float("inf"):
                d.append((j,b+1))
sa,fa=0,0

for i in range(n):
    if s[i]>=f[i]:
        fa+=1
    else:
        sa+=1
if fa>sa:
    print("Fennec")
else:
    print("Snuke")

from sys import setrecursionlimit
setrecursionlimit(10000000)

def solve():
    N = int(input())
    adj = [list() for _ in range(N)]
    for _ in range(N-1):
        a,b = map(int,input().split())
        adj[a-1].append(b-1)
        adj[b-1].append(a-1)

    # path
    goal = N-1
    path = [0]
    candidates = [adj[0][:]]
    while path[-1] != goal:
        while not candidates[-1]:
            candidates.pop()
            path.pop()
        u = candidates[-1].pop()
        candidates.append([n for n in adj[u] if n != path[-1]])
        path.append(u)

    black = path[(len(path)-1)//2]
    white = path[(len(path)-1)//2+1]

    # count
    path = [black]
    candidates = [[n for n in adj[black] if n != white]]
    cnt = 0
    try:
        while True:
            while not candidates[-1]:
                cnt += 1
                candidates.pop()
                path.pop()
            u = candidates[-1].pop()
            candidates.append([n for n in adj[u] if n != path[-1]])
            path.append(u)
    except IndexError:
        pass
    bscore = cnt
    print('Fennec' if bscore*2 > N else 'Snuke')


def __starting_point():
    solve()
__starting_point()

from networkx import*
N,*t=map(str.split,open(0))
s=shortest_path_length
x=s(G:=Graph(t),'1')
y=s(G,*N)
print('FSennunkeec'[sum(x[k]>y[k]for k in x)*2>=len(x)::2])

ai = lambda: list(map(int,input().split()))
ai_ = lambda: [int(x)-1 for x in input().split()]

n = int(input())

path = [[] for _ in range(n)]
for _ in range(n-1):
    a,b = ai_()
    path[a].append(b)
    path[b].append(a)

from collections import deque
q = deque()
q.append(0)

d1 = [float('inf') for _ in range(n)]
d1[0] = 0
w = set()
while q:
    v = q.popleft()
    w.add(v)
    for vv in path[v]:
        if vv not in w:
            d1[vv] = d1[v] + 1
            q.append(vv)


q = deque()
q.append(n-1)

dn = [float('inf') for _ in range(n)]
dn[n-1] = 0
w = set()
while q:
    v = q.popleft()
    w.add(v)
    for vv in path[v]:
        if vv not in w:
            dn[vv] = dn[v] + 1
            q.append(vv)


d = [1 if d1[v] <= dn[v] else -1 for v in range(n)]

if sum(d) > 0:
    print('Fennec')
else:
    print('Snuke')


def dfs(x):
    d = [-1] * (N + 1)
    stack = [x]
    while stack:
        x = stack.pop()
        for i in G[x]:
            if d[i] == -1:
                d[i] = d[x] + 1
                stack.append(i)
    return d

N = int(input())
G = [set() for _ in range(N + 1)]
for _ in range(N - 1):
    a, b = map(int, input().split())
    G[a].add(b)
    G[b].add(a)

d1, dn = dfs(1), dfs(N)
num = 0
for i in range(1, N + 1):
    if d1[i] <= dn[i]:
        num += 1
if num > N // 2:
    print('Fennec')
else:
    print('Snuke')

#Snuke vs Fennec
N = int(input())
tree = [[] for _ in range(N)]
for _ in range(N-1):
    a,b = list(map(int, input().split()))
    a-=1
    b-=1
    tree[a].append(b)
    tree[b].append(a)
 
 
def dist(n, lis):
    lis[n] = 0
    node = [n]
    while node:
        s = node.pop()
        d = lis[s]
        for t in tree[s]:
            if lis[t] != -1:
                continue
            lis[t] = d + 1
            node.append(t)
    return lis
 
 
from_feneck = dist(0, [-1]*N)
from_Snuke = dist(N-1, [-1]*N)
 
feneck = 0
for i,j in zip(from_feneck, from_Snuke):
    if i<=j:
        feneck += 1
    else:
        feneck -= 1
    
if feneck <= 0:
    print("Snuke")
else:
    print("Fennec")


from collections import deque
N = int(input())
edge = [[] for _ in range(N)]
for _ in range(N - 1):
    a, b = map(int, input().split())
    edge[a - 1].append(b - 1)
    edge[b - 1].append(a - 1)
d = [[-1] * N for _ in range(2)]
for i in range(2):
    d[i][i * (N - 1)] = 0
    q = deque([i * (N - 1)])
    while len(q) > 0:
        u = q.popleft()
        for v in edge[u]:
            if d[i][v] > -1:
                continue
            d[i][v] = d[i][u] + 1
            q.append(v)
S = 0
F = 0
for i in range(N):
    if d[0][i] > d[1][i]:
        S += 1
    else:
        F += 1
if F > S:
    print("Fennec")
else:
    print("Snuke")

from collections import*
input=open(0).readline
n=int(input())
e=[[]for _ in range(n)]
for _ in range(n-1):
    a,b=map(int,input().split())
    e[a-1].append(b-1)
    e[b-1].append(a-1)
f=[0]*n
v=[1]+[0]*~-n
q=deque([(0,0)])
while q:
    t,c=q.pop()
    v[t]=1
    f[t]=c
    for i in e[t]:
        if not v[i]:
            q.append((i,c+1))
s=[0]*n
v=[0]*~-n+[1]
q=deque([(n-1,0)])
while q:
    t,c=q.pop()
    v[t]=1
    s[t]=c
    for i in e[t]:
        if not v[i]:
            q.append((i,c+1))
a=b=0
for i,j in zip(f,s):
    if i<=j:
        a+=1
    else:
        b+=1
if a>b:
    print('Fennec')
else:
    print('Snuke')

import heapq
# v:頂点数, s:始点, path[i]:[[cost,to]...] i=fromの隣接リスト
def dijkstra(v,s,path):
    inf = float('inf')

    # 距離をinfで初期化
    d = [inf for i in range(v)]
    d[s] = 0

    # sへの距離は0
    q = [[0,s]]
    heapq.heapify(q)

    # 距離が最小の頂点から更新していけば
    # p[1]から行ける
    while q:
        p = heapq.heappop(q)

        # 頂点p[1]までの距離がheapないのp[1]までの距離より小さい場合、continue
        if d[p[1]]<p[0]:
            continue

        # 頂点p[1]から伸びる、全ての辺の距離を確認
        for i in range(len(path[p[1]])):
            # 頂点p[1]から行ける頂点の距離がp[1]までの距離とp[1]からの距離の和より小さい場合 -> 距離を更新し、heapに追加
            if d[path[p[1]][i][1]] > d[p[1]] + path[p[1]][i][0]:
                d[path[p[1]][i][1]] = d[p[1]]+path[p[1]][i][0]
                heapq.heappush(q,[d[path[p[1]][i][1]], path[p[1]][i][1]])
    return d

def path_recovery(e,d,path):
    # 経路
    route = [e]
    # 残りの距離
    a = d[e]
    while a!=0:
        for i in range(len(path[e])):
            if d[path[e][i][1]]+path[e][i][0]==a:
                route.append(path[e][i][1])
                a -= path[e][i][0]
                e = path[e][i][1]
                break
    route.reverse()
    return route

class UnionFind:
    # 初期化
    def __init__(self, n):
        # 根なら-size, 子なら親の頂点
        self.par = [-1] * n
        # 木の高さ
        self.rank = [0] * n

    # 検索
    def find(self, x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        # 異なる集合に属する場合のみ併合
        if x != y:
            # 高い方をxとする。
            if self.rank[x] < self.rank[y]:
                x,y = y,x
            # 同じ高さの時は高さ+1
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            # yの親をxとし、xのサイズにyのサイズを加える
            self.par[x] += self.par[y]
            self.par[y] = x

    # 同集合判定
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # 集合の大きさ
    def size(self, x):
        return -self.par[self.find(x)]

n = int(input())

l = [[] for i in range(n)]
for i in range(n-1):
    a,b = map(int, input().split())
    # dijkstraのlibraryに合わせるため、距離1を追加
    l[a-1].append([1,b-1])
    l[b-1].append([1,a-1])

d = dijkstra(n,0,l)

p = path_recovery(n-1,d,l)

x = p[(len(p)-1)//2]
y = p[(len(p)-1)//2+1]

for i in range(len(l[x])):
    if l[x][i][1]==y:
        l[x].pop(i)
        break
for i in range(len(l[y])):
    if l[y][i][1]==x:
        l[y].pop(i)
        break

u = UnionFind(n)

for i in range(len(l)):
    for j in range(len(l[i])):
        u.unite(i,l[i][j][1])


if u.size(0)>u.size(n-1):
    print('Fennec')
else:
    print('Snuke')

from heapq import heappush, heappop

# 入力
N = int(input())
a, b = (
    list(zip(*(list(map(int, input().split())) for _ in range(N - 1)))) if N - 1 else
    ((), ())
)

# 頂点1, N から各蝶点への距離を求める
G = [{} for _ in range(N + 1)]
for x, y in zip(a, b):
    G[x][y] = 1
    G[y][x] = 1
INF = 10**10


def dijkstra(G, s):
    dp = [INF for _ in range(len(G))]
    q = []
    heappush(q, (0, s))
    while q:
        c, i = heappop(q)
        if dp[i] == INF:
            dp[i] = c
            for j, w in list(G[i].items()):
                heappush(q, (c + w, j))
    return dp


dp1 = dijkstra(G, 1)
dpN = dijkstra(G, N)
# 頂点Nより頂点1のほうが近い、または、頂点1と頂点Nとの距離が等しいは
# 頂点1から頂点Nの間のパスに含まれる頂点のうち、Fennecが塗れる頂点である。
ans = (
    'Fennec' if sum(dp1[i] <= dpN[i] for i in range(1, N + 1)) > N // 2 else
    'Snuke'
)

# 出力
print(ans)


N, = list(map(int, input().split()))
G = [set() for _ in range(N+1)]
for i in range(N-1):
    A, B = list(map(int, input().split()))
    G[A].add(B)
    G[B].add(A)

path = []
stack = [1]
vs = set()
while stack:
    v = stack.pop()
    if v > 0:
        vs.add(v)
        path.append(v)
        for u in G[v]:
            if u in vs:
                continue
            if u == N:
                stack = []
                path.append(u)
                break
            stack += [-v, u]
    else:
        path.pop()

x = path[-(-len(path)//2)]

stack = [1]
vs = set()
while stack:
    v = stack.pop()
    vs.add(v)
    for u in G[v]:
        if u in vs:
            continue
        if u == x:
            continue
        stack.append(u)
x = len(vs)-1
y = N - 2 - x
if x>y:
    print("Fennec")
else:
    print("Snuke")


import sys
sys.setrecursionlimit(10**8)
N=int(input())
G=[[] for i in range(N)]
F=[0 for i in range(N)]
A=[]
for i in range(N-1):
  a,b=map(int,input().split())
  a-=1;b-=1
  G[a].append(b)
  G[b].append(a)
  A.append([a,b])
  
def dfs(s,R):
  F[s]=1
  
  if s==N-1:
    return [s]
  else:
    for n in G[s]:
      if F[n]==0:
        k=dfs(n,R)
        if len(k)!=0:
          k.append(s)
          return k
     
  return []
  
root=dfs(0,[])
#print(root[::-1])
p=root[::-1][len(root)//2+len(root)%2-1]
q=root[::-1][len(root)//2+len(root)%2]

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

uf = UnionFind(N) 
for i in range(N-1):
  a,b=map(int,A[i])
  if a==p and b==q:
    continue
  if a==q and b==p:
    continue
  uf.union(a, b)

scoreA=uf.size(0)
scoreB=N-scoreA
#print(scoreA,scoreB)

if scoreA>scoreB:
  print("Fennec")
else:
  print("Snuke")

from collections import deque

def dfs(graph, start, goal):
    s_stack = deque()
    g_stack = deque()
    visited = [0 for i in range(N+1)]
    s_stack.append([start,0])
    g_stack.append([goal, 0])
    visited[start] = 1 
    visited[goal] = 1 
    s_cnt = 1
    g_cnt = 1
    round = 0
    while s_stack or g_stack:
        while s_stack:
            a,cost = s_stack.popleft()
            if cost > round:
                s_stack.appendleft([a,cost])
                break
            for b in graph[a].keys():
                if not visited[b]:
                    s_stack.append([b,cost+1])
                    visited[b] += 1 
                    s_cnt += 1
        while g_stack:
            a, cost = g_stack.popleft()
            if cost > round:
                g_stack.appendleft([a,cost])
                break
            for b in graph[a].keys():
                if not visited[b]:
                    g_stack.append([b,cost+1])
                    visited[b] += 1 
                    g_cnt += 1
        round += 1
    # print(s_cnt, g_cnt)
    return s_cnt > g_cnt

N = int(input())
graph = {}
for i in range(N-1):
    a,b = map(int, input().split())
    if a not in graph:
        graph[a] = {}
    if b not in graph:
        graph[b] = {}
    graph[a][b] = graph[b][a] = 1
print('Fennec' if dfs(graph,1,N) else 'Snuke')

from networkx import*
(N,),*t=map(str.split,open(0))
s=shortest_path_length
x=s(G:=Graph(t),'1')
y=s(G,N)
print('FSennunkeec'[sum(x[k]>y[k]for k in x)*2>=int(N)::2])

from networkx import*
(N,),*t=map(str.split,open(0))
x,y=[shortest_path_length(Graph(t),v)for v in('1',N)]
print('FSennunkeec'[sum(x[k]>y[k]for k in x)*2>=int(N)::2])

from collections import deque

def bfs(start):
    queue = deque([start])
    visited = []

    while queue:
        label = queue.pop()

        visited.append(label)

        for v in d[label]:
            if tekazu[v] == float("inf"):
                tekazu[v] = tekazu[label] + 1
                queue.appendleft(v)

    return

n = int(input())
d = [[] for _ in range(n)]

for _ in range(n - 1):
    a, b = map(int, input().split())
    d[a - 1].append(b - 1)
    d[b - 1].append(a - 1)

tekazu = [float("inf") for _ in range(n)]
tekazu[0] = 0
bfs(0)
tekazu_Fennec = tekazu

tekazu = [float("inf") for _ in range(n)]
tekazu[-1] = 0
bfs(n - 1)
tekazu_Snuke = tekazu

Fennec = 0
Snuke = 0

for i in range(n):
    if tekazu_Fennec[i] <= tekazu_Snuke[i]:
        Fennec += 1
    else:
        Snuke += 1

if Fennec > Snuke:
    print("Fennec")
else:
    print("Snuke")


import math
import sys
sys.setrecursionlimit(1000000)
N = int(input())
graph = {}
SCORE = 0
def dfs(visted,v,depth):
    visted[v] = depth
    for next_v in graph[v]:
        if  visted[next_v]  == -1 :
            dfs(visted,next_v,depth + 1)




for _ in range(N-1):
    a,b = list(map(int,input().split(" ")))
    if a not in graph:
        graph[a] = [b]
    else:
        graph[a].append(b)

    if b not in graph:
        graph[b] = [a]
    else:
        graph[b].append(a)

vF = [-1] * (N + 1)
vF[1] = 0
dfs(vF,1,0)
# print(vF)

vS = [-1] * (N + 1)
vS[N] = 0

dfs(vS,N,0)
# print(vS)

fc = 0
sc = 0

for f,s in zip(vF[1:N + 1],vS[1:N + 1]):
    if f <= s:
        fc += 1
    else:
        sc += 1

# print(fc,sc)
if fc > sc:
    print("Fennec")
else:
    print("Snuke")