#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template <typename T>
using VT = vector<T>;
template <typename T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;
const double EPS = 1e-9;
int n, m, k;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  vector<bool> hole(n, false);
  for (int i = 0; i < m; ++i) {
    int idx;
    scanf("%d", &idx);
    --idx;
    hole[idx] = true;
  }
  int now = 0;
  bool isOut = hole[now];
  for (int i = 0; i < k; ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    --u;
    --v;
    if (!isOut) {
      if (now == u)
        now = v;
      else if (now == v)
        now = u;
    }
    if (hole[now]) isOut = true;
  }
  printf("%d\n", now + 1);
}
