* Line 1: Three space separated integers N (1 <= N <= 40,000), M (1 <= M <= 40,000), and R (0 <= R <= 100,000) indicating respectively the number of sites on the left side of the river, the number of sites on the right side of the river, and the number of routes.
* Lines 2..N+1: The (i+1)th line has a single integer, L_i (0 <= L_i <= 40,000), indicating the value of the ith tourist site on the left side of the river.
* Lines N+2..N+M+1: The (i+N+1)th line has a single integer, R_i (0 <= R_i <= 40,000), indicating the value of the ith tourist site on the right side of the river.
* Lines N+M+2..N+M+R+1: Each line contains two space separated integers I (1 <= I <= N) and J (1 <= J <= M) indicating there is a bidirectional route between site I on the left side of the river and site J on the right side of the river.