Birthday Gift

Limits 1s, 512 MB

Snoopy and Reza are best friends and today is Reza's birthday. Now Snoopy wants to join Reza's birthday celebration and gift him some balloons. In their country, there are $N$ cities numbered from $1$ to $N$. Snoopy lives in city $1$ and Reza lives in city $N$. There are $M$ bidirectional roads, the $i^{th}$ road is between the city $u_i$ and $v_i$ and $c_i$ is the cost of using this road. There is a weird rule in their country. For every road $i$, there is a restriction $k_i$, which means one can use the $i^{th}$ road carrying at most $k_i$ balloons. Initially, Snoopy has $C$ taka and $K$ balloons.

Now Snoopy wants to know what is the maximum number of balloons he can gift Reza. For this he wants your help.

Input

Output

Print the maximum number of balloons Snoopy can gift.

Samples

InputOutput
5 4 9 15
1 2 3 10
1 4 10 12
2 5 4 12
4 5 9 15
10

Snoopy can choose the path 1->2->5 which costs 7 and he can gift 10 balloons.

InputOutput
5 5 15 15
1 3 4 12
1 4 3 10
4 2 8 10
3 2 16 12
2 5 4 12
10

Snoppy can choose the path 1->4->2->5 which costs 15 and he can gift 10 balloons.

InputOutput
6 6 20 7
1 2 1 20
2 3 1 20
3 4 1 30
3 5 1 10
4 6 1 3
5 6 2 5
5

Snoppy can choose the path 1->2->3->5->6 which costs 5 and he can gift 5 balloons.