Under construction

Still being built. Things may change

Hanyang Cherry Picking Contest

Time limit1sMemory limit1024 MB

Summary
Two players alternately take tree vertices by moving to a child of the last taken vertex, and the task is to find the winner under optimal play.
Level

Hard8 of 10

Topics
Tree, Game theory, Dynamic programming
Solved
No attempts yet

Problem

Sehun and Cheolmin took part in the 10th HCPC (Hanyang Cherry Picking Contest). The two met in the final and compete for the title. The rules of HCPC are as follows.

  1. A tree with NN vertices is given, rooted at vertex 11. Each vertex has an integer between 00 and 101010^{10}, inclusive.
  2. Each match is played between two players. One player moves first and the other moves second.
  3. A player gains the score of a vertex by taking that vertex. The score of a vertex is the number written on it.
  4. The vertex most recently taken by the player of the previous turn is called the cherry vertex.
  5. On the first turn, the first player always takes the root and passes the turn to the second player. The initial cherry vertex is therefore the root.
  6. After that, the players take turns. On each turn, the player picks one child of the cherry vertex, takes it, and passes the turn.
  7. A vertex already taken by either player cannot be taken again by either player.
  8. If the cherry vertex has exactly one child, the player must take that child.
  9. If the cherry vertex has no children, the nearest vertex that still has a child available is treated as the cherry vertex, and the turn proceeds.
  10. The match continues until no vertex can be taken. The player whose taken vertices have the higher total score wins. If the totals are equal, the match is a draw.

Sehun moves first and Cheolmin moves second. If both players play optimally, who is the winner of HCPC?

Input

The first line contains NN. (2≤N≤200 000)(2\le N\le 200\,000)

From the second line onward, the next N−1N-1 lines each contain two integers uu and vv, separated by a space. They describe an undirected edge between vertex uu and vertex vv. (1≤u,v≤N;(1\le u,v\le N; u≠v)u\ne v)

The N+1N+1-th line contains NN integers a1,a2,…,aNa_1,a_2,\ldots,a_N. aia_i is the number written on vertex ii. (0≤ai≤1010)(0\le a_i\le 10^{10})

Output

If Sehun wins, print Sehun. If Cheolmin wins, print Cheolmin. If the match is a draw, print Draw.

Examples3

  1. Example 1

    Input
    7
    1 2
    1 7
    2 4
    3 4
    4 5
    4 6
    2 0 2 3 1 2 3
    
    Expected output
    Cheolmin
    
  2. Example 2

    Input
    5
    1 2
    2 3
    3 4
    1 5
    5 4 3 2 1
    
    Expected output
    Sehun
    
  3. Example 3

    Input
    5
    1 2
    2 3
    3 4
    1 5
    1 3 1 7 1
    
    Expected output
    Cheolmin