#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const int inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
int n, m, k;
int is_hole[1001000];
int pos = 0;
bool is_stable = false;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < m; i++) {
    int x;
    scanf("%d", &x);
    is_hole[x - 1] = 1;
  }
  if (is_hole[pos]) is_stable = true;
  while (k--) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--;
    v--;
    if (is_stable) continue;
    if (pos == u || pos == v) {
      int target = u + v - pos;
      pos = target;
    }
    if (is_hole[pos]) is_stable = true;
  }
  printf("%d\n", pos + 1);
  return 0;
}
