#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  bool hole[n + 1];
  bool contain[n + 1];
  memset(hole, false, sizeof hole);
  memset(contain, false, sizeof contain);
  int first;
  while (m--) {
    scanf("%d", &first);
    hole[first] = true;
  }
  int u, v;
  contain[1] = true;
  while (k--) {
    scanf("%d%d", &u, &v);
    if (contain[u] && hole[u])
      continue;
    else if (contain[v] && hole[v])
      continue;
    else {
      swap(contain[u], contain[v]);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (contain[i]) {
      return !printf("%d", i);
    }
  }
  return 0;
}
