Problem:
Score : 400 points

Problem Statement

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 1

7
3 6
1 2
3 1
7 4
5 7
1 4

Sample Output 1

Fennec

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

Sample Input 2

4
1 4
4 2
2 3

Sample Output 2

Snuke

Solution in Rust (1.15.1) (judge verdict: Accepted)

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};

#[allow(unused_imports)]
use std::io::Write;

const B: usize = 1;
const W: usize = 2;

fn dfs(edges: &[Vec<usize>], i: usize, t: usize, r: &mut Vec<usize>) -> bool {
    if i == t {
        return true;
    }

    for &n in edges[i].iter() {
        if r.len() >= 2 && r[r.len()-2] == n {
            continue;
        }

        r.push(n);
        if dfs(edges, n, t, r) {
            return true;
        }
        r.pop();
    }
    false
}

fn dfs2(edges: &[Vec<usize>], colors: &[usize], i: usize, seen: &mut Vec<bool>, c: usize) {
    if seen[i] {
        return;
    }
    seen[i] = true;
    for &n in edges[i].iter() {
        if colors[n] == c {
            continue;
        }
        dfs2(edges, colors, n, seen, c);
    }
}


fn main() {
    input!{
      n: usize,
      abs: [(usize, usize); n-1],
    }

    let mut edges = vec![vec![]; n];
    for &(a, b) in abs.iter() {
        edges[a-1].push(b-1);
        edges[b-1].push(a-1);
    }

    let mut colors = vec![0; n];
    colors[0] = B;
    colors[n-1] = W;

    let mut r = vec![0];
    dfs(&edges, 0, n-1, &mut r);

    {
        let mut i = 0;
        let mut j = r.len()-1;
        loop {
            i += 1;
            if i >= j {
                break;
            }
            colors[r[i]] = B;
            j -= 1;
            if i >= j {
                break;
            }
            colors[r[j]] = W;
        }
    }
    let mut black = vec![false; n];
    dfs2(&edges, &colors, 0, &mut black, W);

    let mut b = 0;
    for i in 0..n {
        if black[i] {
            b += 1;
        }
    }
    if b > (n-b) {
        println!("{}", "Fennec");
    } else {
        println!("{}", "Snuke");
    }
}