After finishing his studies, SpongeBob founded a company called Rahyab-Tech. Rahyab-Tech eveloped a mobile app called Rahyab, which helps drivers choose their path through inter-city roads. After a while, Rahyab became so popular that all drivers started using it during their trips.

SpongeBob discovered that one of the hardest problems he needs to solve is finding appropriate routes for drivers who want to go from Motel-Ghu to Tehran on Fridays. Every route starts with Motel-Ghu, and ends in Tehran after passing through some intermediate cities using the roads. Every road is a one-directional way from one city to another city. Roads do not have capacities. However, when more cars pass through a road, the road gets damaged faster. To avoid this, the government has the policy of charging every car by the most crowded road it has passed during its trip. The government’s surveillance system counts the number of cars passing through each road, and at the end of the day, each car is charged based on the roads it has passed. A car that passes through roads 
r
1
,
…
,
r
k
r 
1
​
 ,…,r 
k
​
 , is charged 
t
r
1
2
,
…
,
t
t
k
2
t 
r 
1
​
 
2
​
 ,…,t 
t 
k
​
 
2
​
  where 
t
r
i
t 
r 
i
​
 
​
  is the number of cars passing through 
r
i
r 
i
​
  during that day.

Rahyab’s suggested routes (from Motel-Ghu to Tehran) for different drivers are not necessarily the same. All drivers follow their suggested routes, but if any driver discovers somehow that (s)he could be charged less by using a route other than Rahyab’s suggestion, Rahyab loses its customer loyalty, something intolerable for SpongeBob. Thus, the route suggested to each driver should be one of the best possible routes for that driver.

SpongeBob has developed an intelligent program that at the start of a day, predicts the exact number of cars 
C
C that travel from Motel-Ghu to Tehran on that day. Now, he has hired you to improve Rahyab in a way that given the map of roads and the number 
C
C, its suggested routes to drivers are such that no driver could benefit from changing his/her route.

ورودی
There are multiple test cases in the input. Each test case starts with a line containing five space-separated numbers 
N
N, 
E
E, 
M
M, 
T
T, and 
C
C. Integers 
N
N and 
E
E are respectively the number of cities and roads in the map (
2
≤
N
≤
500
2≤N≤500, 
0
≤
E
≤
100
,
000
0≤E≤100,000). The cities are numbered 
1
1 through 
N
N. Integers 
M
M and 
T
T are the number of Motel-Ghu and Tehran respectively (
1
≤
M
≠
T
≤
N
1≤M

=T≤N). Integer 
C
C is the number of trips from Motel-Ghu to Tehran on Friday (
0
≤
C
≤
1
0
6
0≤C≤10 
6
 ). Each of the next 
E
E lines contains two space-separated integers 
x
i
x 
i
​
  and 
y
i
y 
i
​
  (
1
≤
x
i
,
y
i
≤
N
1≤x 
i
​
 ,y 
i
​
 ≤N) denoting a one-directional road from city 
x
i
x 
i
​
  to city 
y
i
y 
i
​
 . It is guaranteed that there is at least one route from Motel-Ghu to Tehran. The input terminates with a line containing 
0
0 
0
0 
0
0 
0
0 
0
0 which should not be processed.

خروجی
For each test case, print the total amount that all cars are charged if Rahyab’s routing plans meet the conditions mentioned above and are followed by all drivers. It is known that the total amount is unique.

مثال
ورودی نمونه ۱
3 3 1 3 7
1 3
1 2
2 3
4 5 2 3 6
1 2
1 3
2 4
4 3
2 3
0 0 0 0 0
Plain text
خروجی نمونه ۱
91
54                    write c++ code