#Q245. 「一本通 6.7 例 3」移棋子游戏

「一本通 6.7 例 3」移棋子游戏

Description

Given a directed acyclic graph (DAG) with N N nodes, some of the nodes contain chess pieces. Two players take turns moving the pieces.

Each move consists of moving any one piece along a directed edge to another node. The player who cannot make a move loses the game.

For the given graph and initial positions of the pieces, assuming both players play optimally, determine whether the first player has a winning strategy or not.

Input Format

The first line contains three integers N,M,K N, M, K , where N N is the total number of nodes in the graph, M M is the number of edges, and K K is the number of chess pieces.

The next M M lines each contain two integers X X and Y Y , representing a directed edge from node X X to node Y Y .

The following line contains K K space-separated integers, indicating the initial positions of the chess pieces.

Output Format

If the first player has a winning strategy, output win. Otherwise, output lose.

Sample 1

6 8 4
2 1
2 4
1 4
1 5
4 5
1 3
3 5
3 6
1 2 4 6

win

Constraints and Hints

For all test cases, N2000,M6000,1KN N \le 2000, M \le 6000, 1 \le K \le N .