Each test contains multiple test cases. The first line contains the number of test cases $T$. Description of the test cases follows.
The first line of each test case contains four integers $n,m,S,K$
The next $m$ lines each line contains four integers $x,y,w,t$ represent an directed edge connect $x$ and $y$ with cost $w$,$t=0$ represents it's a common edge,$t=1$ represents it's a special edge.
$1\le \sum_{}{}{m} ,\sum_{}{}{n} \le 10^6,1\le x,y,S \le n,1\le w,K\le 10^9$
$K \le w_i (1\le i \le m)$