## implementation

#include <iostream>
#include <vector>
#include <limits>
#include <functional>
#define repeat(i,n) for (int i = 0; (i) < (n); ++(i))
using namespace std;

struct edge_t { int to, cap, rev; };
int maximum_flow_destructive(int s, int t, vector<vector<edge_t> > & g) { // ford fulkerson, O(EF)
int n = g.size();
vector<bool> used(n);
function<int (int, int)> dfs = [&](int i, int f) {
if (i == t) return f;
used[i] = true;
for (edge_t & e : g[i]) {
if (used[e.to] or e.cap <= 0) continue;
int nf = dfs(e.to, min(f, e.cap));
if (nf > 0) {
e.cap -= nf;
g[e.to][e.rev].cap += nf;
return nf;
}
}
return 0;
};
int result = 0;
while (true) {
used.clear(); used.resize(n);
int f = dfs(s, numeric_limits<int>::max());
if (f == 0) break;
result += f;
}
return result;
}
void add_edge(vector<vector<edge_t> > & g, int from, int to, int cap) {
g[from].push_back((edge_t) {   to, cap, int(g[  to].size()    ) });
g[  to].push_back((edge_t) { from,   0, int(g[from].size() - 1) });
}
int maximum_flow(int s, int t, vector<vector<edge_t> > g /* adjacency list */) { // ford fulkerson, O(FE)
return maximum_flow_destructive(s, t, g);
}

int main() {
int n, a, b; cin >> n >> a >> b;
vector<vector<edge_t> > g(n);
vector<vector<edge_t> > h(n);
repeat (i,a) {
int x, y; cin >> x >> y; -- x; -- y;