#include #include #include using namespace atcoder; using mint = modint998244353; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000001 int main(){ int N,M,L; cin>>N>>M>>L; mf_graph G(2+N+M); int S = N+M,T = N+M+1; vector s(L),t(L); vector ind(L); rep(i,L){ cin>>s[i]>>t[i]; s[i]--;t[i]--; ind[i] = G.add_edge(s[i],N+t[i],1); } vector inds(N),indt(M); rep(i,N)indt[i] = G.add_edge(S,i,1); rep(i,M)indt[i] = G.add_edge(N+i,T,1); vector f(L,false); int ans = G.flow(S,T); vector p; rep(i,L){ if(G.get_edge(ind[i]).flow==0)f[i] = true; else p.push_back(i); } rep(i,p.size()){ int cur = ans; int ii = p[i]; auto GG = G; G.change_edge(ind[ii],0,0); cur--; if(G.flow(s[ii],N+t[ii],1)){ cur++; } else{ G.change_edge(inds[s[ii]],1,0); G.change_edge(indt[t[ii]],1,0); } if(cur==ans)f[ii] = true; G = GG; } rep(i,L){ cout<<(f[i]?"Yes":"No")<