n,m,q=map(int,input().split()) e=[] d={} for i in range(m): a,b=map(int,input().split()) a-=1 b-=1 e+=[(a,b)] d[(a,b)]=i u=[1]*m p=[] for i in range(q): a,b=map(int,input().split()) a-=1 b-=1 u[d[(a,b)]]=0 p+=[d[(a,b)]] ans=[-1]*n r=[-1]*n v=[[i] for i in range(n)] def root(a): while r[a]!=-1: a=r[a] return a def union(a,b): ra=root(a) rb=root(b) if ra==rb: return if len(v[ra])