#include <bits/stdc++.h>
using namespace std;
bool biao[1000000], ans[1000001];
int main() {
  long int n, m, k;
  scanf("%ld %ld %ld", &n, &m, &k);
  long int i;
  for (i = 1; i <= m; i++) {
    long int q;
    scanf("%ld", &q);
    biao[q] = 1;
  }
  ans[1] = 1;
  long int bone1 = 1, bone2 = 1, a1, a2;
  for (i = 0; i < k; i++) {
    scanf("%ld %ld", &a1, &a2);
    if (biao[a1] == 1 && ans[a1] == 1) {
      bone1 = a1;
      printf("%ld", bone1);
      return 0;
    } else if (biao[a2] == 1 && ans[a2] == 1) {
      bone1 = a2;
      printf("%ld", bone1);
      return 0;
    } else if (ans[a1] == 1) {
      ans[a2] = 1;
      ans[a1] = 0;
      bone2 = a2;
    } else if (ans[a2] == 1) {
      ans[a1] = 1;
      ans[a2] = 0;
      bone2 = a1;
    }
  }
  printf("%ld", bone2);
  return 0;
}
