#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long int a[1000005], u[300005], v[300005];
int main() {
  long long int n, m, k, ans, i, num;
  scanf("%lld", &n);
  scanf("%lld", &m);
  scanf("%lld", &k);
  memset(a, 0, sizeof(a));
  for (i = 0; i < m; i++) {
    scanf("%lld", &num);
    a[num] = 1;
  }
  ans = 1;
  for (i = 0; i < k; i++) {
    scanf("%lld", &u[i]);
    scanf("%lld", &v[i]);
  }
  for (i = 0; i < k; i++) {
    if (a[ans] == 1) {
      break;
    }
    if (u[i] == ans) {
      ans = v[i];
    } else if (v[i] == ans) {
      ans = u[i];
    }
  }
  printf("%lld\n", ans);
  return 0;
}
