QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100

#7986. Game

Statistics

Xiao I and Xiao J are playing a game again.

Xiao J has found a tree with $n$ nodes. Each edge in the tree has two states: open and closed. Initially, all edges in the tree are open.

A piece is initially placed on node $1$. Xiao I can move the piece, and their goal is to move the piece to a node with a degree of exactly $1$. Xiao J can close edges in the tree, and their goal is to prevent Xiao I from moving the piece to a node with a degree of exactly $1$.

The game consists of several rounds. Each round proceeds as follows:

  1. Xiao I's win condition check: If the piece is on a node with a degree of exactly $1$, Xiao I wins. Otherwise, proceed to step 2.
  2. Xiao J's move: Xiao J chooses an currently open edge and closes it permanently. Proceed to step 3. If there are no currently open edges, skip this action and proceed to step 3.
  3. Xiao I's move: Xiao I chooses an open edge connected to the current node and moves the piece to the other node connected by that edge. If no such edge exists, Xiao J wins. Otherwise, a new round begins, and the game returns to step 1.

Xiao J wants to know who will win if both Xiao I and Xiao J know the structure of the tree and play optimally.

Input

The input is read from standard input.

The first line contains an integer $n$ ($1 \le n \le 10^5$), representing the number of nodes in the tree. The next $n-1$ lines each contain two integers $u, v$ ($1 \le u, v \le n$), representing an edge in the tree.

Output

The output is written to standard output.

If Xiao I wins, output You win, temporarily.. Otherwise, output Wasted..

Examples

Input 1

6
1 2
2 3
2 4
1 5
5 6

Output 1

Wasted.

Note 1

Xiao J's strategy is as follows:

  • Xiao J closes $(1,2)$, so Xiao I can only move to $5$.
  • Xiao J closes $(5,6)$, so Xiao I must move back to $1$.
  • Xiao J closes $(1,5)$, so Xiao I cannot move.

Input 2

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

Output 2

You win, temporarily.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.