#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T &u) {
  u = 0;
  char c = getchar();
  int flag = 0;
  while (c < '0' || c > '9') flag |= (c == '-'), c = getchar();
  while (c >= '0' && c <= '9')
    u = (u << 3) + (u << 1) + (c ^ 48), c = getchar();
  if (flag) u = -u;
}
bool checkmin(int &a, int b) { return (b < a ? a = b, 1 : 0); }
bool checkmax(int &a, int b) { return (b > a ? a = b, 1 : 0); }
const int N = 1000005;
int n, m, k, x;
int hole[N], a[N];
void init() {
  read(n);
  read(m);
  read(k);
  for (int i = 1; i <= m; ++i) {
    read(x);
    hole[x] = 1;
  }
}
void solve() {
  if (hole[1]) {
    printf("1\n");
    return;
  }
  int ans = 1, u, v;
  a[1] = 1;
  while (k--) {
    read(u), read(v);
    if (a[u]) {
      a[u] = 0;
      a[v] = 1;
      ans = v;
    } else if (a[v]) {
      a[u] = 1;
      a[v] = 0;
      ans = u;
    }
    if (hole[ans]) break;
  }
  printf("%d\n", ans);
}
int main() {
  init();
  solve();
  return 0;
}
