import heapq

N = int(eval(input()))

T = [[] for i in range(N)]

for i in range(N - 1):

    a, b = list(map(int, input().split()))

    a, b = a - 1, b - 1

    T[a].append([b, 1])

    T[b].append([a, 1])





def dijkstra(x):

    d = [float('inf')] * N

    d[x] = 0

    visited = {x}



    # d, u

    hq = [(0, x)]



    while hq:

        u = heapq.heappop(hq)[1]

        visited.add(u)



        for node, cost in T[u]:

            if (node not in visited) and d[node] > d[u] + cost:

                d[node] = d[u] + cost

                heapq.heappush(hq, (d[u]+cost, node))

    return d





B = dijkstra(0)

W = dijkstra(N - 1)



result = [("B" if b <= w else "W") for b, w in zip(B, W)]

print(("Fennec" if result.count("B") - result.count("W") > 0 else "Snuke"))

import sys

sys.setrecursionlimit(10 ** 9)



N = int(eval(input()))

T = [[] for i in range(N)]

for i in range(N - 1):

    a, b = list(map(int, input().split()))

    a, b = a - 1, b - 1

    T[a].append([b, 1])

    T[b].append([a, 1])





def dfs(n):

    dist = [-1] * N

    dist[n] = 0

    stack = [n]



    while stack:

        u = stack.pop()

        for v, c in T[u]:

            if dist[v] < 0:

                dist[v] = dist[u] + 1

                stack.append(v)

    return dist





Black = dfs(0)

White = dfs(N - 1)



Black_get = 0

for b, w in zip(Black, White):

    if b <= w:

        Black_get += 1



if Black_get > N // 2:

    print('Fennec')

else:

    print('Snuke')

import heapq

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


def dijkstra(x):
    d = [float("inf")] * N
    d[x] = 0
    visited = {x}
    # d, u
    hq = [(0, x)]
    while hq:
        u = heapq.heappop(hq)[1]
        visited.add(u)
        for node, cost in T[u]:
            if (node not in visited) and d[node] > d[u] + cost:
                d[node] = d[u] + cost
                heapq.heappush(hq, (d[u] + cost, node))
    return d


B = dijkstra(0)
W = dijkstra(N - 1)
result = [("B" if b <= w else "W") for b, w in zip(B, W)]
print(("Fennec" if result.count("B") - result.count("W") > 0 else "Snuke"))

import sys

sys.setrecursionlimit(10**9)
N = int(eval(input()))
T = [[] for i in range(N)]
for i in range(N - 1):
    a, b = list(map(int, input().split()))
    a, b = a - 1, b - 1
    T[a].append([b, 1])
    T[b].append([a, 1])


def dfs(n):
    dist = [-1] * N
    dist[n] = 0
    stack = [n]
    while stack:
        u = stack.pop()
        for v, c in T[u]:
            if dist[v] < 0:
                dist[v] = dist[u] + 1
                stack.append(v)
    return dist


Black = dfs(0)
White = dfs(N - 1)
Black_get = 0
for b, w in zip(Black, White):
    if b <= w:
        Black_get += 1
if Black_get > N // 2:
    print("Fennec")
else:
    print("Snuke")

-import heapq +import sys +sys.setrecursionlimit(10**9) -def dijkstra(x): -    d = [float("inf")] * N -    d[x] = 0 -    visited = {x} -    # d, u -    hq = [(0, x)] -    while hq: -        u = heapq.heappop(hq)[1] -        visited.add(u) -        for node, cost in T[u]: -            if (node not in visited) and d[node] > d[u] + cost: -                d[node] = d[u] + cost -                heapq.heappush(hq, (d[u] + cost, node)) -    return d +def dfs(n): +    dist = [-1] * N +    dist[n] = 0 +    stack = [n] +    while stack: +        u = stack.pop() +        for v, c in T[u]: +            if dist[v] < 0: +                dist[v] = dist[u] + 1 +                stack.append(v) +    return dist -B = dijkstra(0) -W = dijkstra(N - 1) -result = [("B" if b <= w else "W") for b, w in zip(B, W)] -print(("Fennec" if result.count("B") - result.count("W") > 0 else "Snuke")) +Black = dfs(0) +White = dfs(N - 1) +Black_get = 0 +for b, w in zip(Black, White): +    if b <= w: +        Black_get += 1 +if Black_get > N // 2: +    print("Fennec") +else: +    print("Snuke")