#define first x #define second y #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair <ll , ll> pii; const int N = 2e5 + 10,mod = 1e9 + 7; const int inf = 0x3f3f3f3f; ll h[N],e[N],w[N],ne[N],idx; ll n,m,s,t,c; ll num[N],...