Under construction

Still being built. Things may change

Attack

Interview

Time limit2sMemory limit1024 MB

Summary
Given a road network and the vampire clan in each city, decide whether the defenders of the attacked city can hold out against a werewolf army that loses min(t, a, b) per day.
Level

Medium5 of 10

Topics
BFS, Simulation, Graph
Solved
No attempts yet

Problem

Everyone knows that vampires exist. Yet nobody stops to think about how close these creatures live. The twilight kingdom has nn cities, and some pairs of cities are connected by two-way roads. Each city has its own vampire clan, which contains kik_i vampires.

Long ago, the vampires drove all werewolves out of the kingdom, which made the werewolves their bitter enemies. The werewolves did not like this. They decided to unite into one squad and attack a city. The attacking squad contains ww werewolves.

However, since vampires always act together, the werewolves doubt that the attack will succeed. They have come to you for help. Vampires can move between two cities connected by a road in one day. Also, during one day of battle, min⁡(t,a,b)\min(t, a, b) vampires defending the besieged city die, and the same number of werewolves die, where aa is the current size of the vampire group, bb is the current size of the werewolf group, and tt is a constant. Using this information, determine whether the vampires can defend the city. A city is besieged if there is a moment when more than zero werewolves are attacking it and zero vampires are defending it.

Input

The first line contains three integers: nn (1≤n≤1051 \le n \le 10^5), the number of cities, mm (1≤m≤1051 \le m \le 10^5), the number of roads, and tt (1≤t≤1031 \le t \le 10^3), the number of vampires and werewolves that die in one day of battle. The second line contains exactly nn integers kik_i (1≤ki≤1041 \le k_i \le 10^4), the number of vampires in the ii-th city. The next mm lines describe the roads, each with two city numbers connected by a road. The last line contains the number of the attacked city and ww (1≤w≤1041 \le w \le 10^4), the size of the werewolf army.

Output

Print <> if the vampires can defend their city, and <> otherwise.

Hint

Note that if all vampires in the city die, and a new group arrives from a neighboring city the next day, the vampires still lose.

Examples2

  1. Example 1

    Input
    5 6 5
    4 5 4 4 1
    1 5
    1 3
    2 1
    3 5
    2 5
    4 3
    1 8
    
    Expected output
    Werewolves win
    
  2. Example 2

    Input
    5 5 1
    3 1 5 1 1
    1 2
    1 5
    1 4
    4 5
    2 3
    1 11
    
    Expected output
    Vampires win