#include #include #include #include #include #include using namespace std; using ll =long long; using pii=pair; set s; const int vmax=100010; vector graph[vmax]; bool visited[vmax]; void bfs(int v){ visited[v]=true; queue q; q.push(v); while(!q.empty()){ int cur=q.front();q.pop(); for(auto &nxt:graph[cur]){ if(visited[nxt]) continue; visited[nxt]=true; q.push(nxt); } } return ; } int main(void){ ll N,M; cin >> N >> M; assert(1LL<=N&&N<=100000LL); assert(0LL<=M&&M<=min(1LL*N*(N-1)/2,200000LL)); for(int loop=0;loop> a >> b >> c; assert(1LL<=a&&a