#include using namespace std; #define fst(t) std::get<0>(t) #define snd(t) std::get<1>(t) #define thd(t) std::get<2>(t) using ll = long long; using P = std::tuple; const int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[8] = {0, 0, -1, 1, -1, 1, -1, 1}; int N, M, Q; P bridge[200000]; bool broken[200000], used[200000]; int id[200000]; vector graph[100000]; int res[100000]; void dfs(int u, int tag){ used[u] = true; res[u] = tag; for(int v : graph[u]){ if(!used[v]){ dfs(v, tag); } } } int main(){ //* std::cin.tie(nullptr); std::ios::sync_with_stdio(false); /*/ /*/ scanf("%d %d %d", &N, &M, &Q); for(int i=0;i=0;--i){ P b = bridge[id[i]]; int u, v; tie(u, v) = b; graph[u].emplace_back(v); graph[v].emplace_back(u); if(used[u] && !used[v]){ dfs(v, i+1); }else if(used[v] && !used[u]){ dfs(u, i+1); } } for(int i=1;i