The first line of input contains two integers, $n$, the number of tourists ($1 \leq n \leq 3 \cdot 10^5$), and $d$, the cost of one negotiation ($0 \leq d \leq 10^9$).
$n$ lines follow. The $i^{th}$ line contains two integers, $a_{i, 1}$ and $a_{i, 2}$, the cost of the two museums that the $i^{th}$ tourist wants to visit ($1 \leq a_{i, 1}, a_{i, 2} \leq 10^9, a_{i, 1} \neq a_{i, 2}$).