#include <bits/stdc++.h>
using namespace std;
template <typename T>
T INF(T a) {
  a = numeric_limits<T>::max();
  return a;
}
template <typename T>
T mINF(T a) {
  a = numeric_limits<T>::min();
  return a;
}
int main() {
  int n, m, k, aux, a1, a2;
  cin >> n >> m >> k;
  vector<bool> vh(n, 0);
  for (int i = 0; i < (m); i++) {
    scanf("%d", &aux);
    aux--;
    vh[aux] = true;
  }
  int op = 0;
  if (vh[op]) {
    cout << op + 1 << endl;
    return 0;
  }
  vector<pair<int, int> > sk(k);
  for (int i = 0; i < (k); i++) {
    scanf("%d %d", &a1, &a2);
    a1--, a2--;
    sk[i].first = a1;
    sk[i].second = a2;
  }
  for (int i = 0; i < (k); i++) {
    a1 = sk[i].first;
    a2 = sk[i].second;
    if (a1 == op) {
      if (vh[a2]) {
        cout << a2 + 1 << endl;
        return 0;
      }
      op = a2;
    } else if (a2 == op) {
      if (vh[a1]) {
        cout << a1 + 1 << endl;
        return 0;
      }
      op = a1;
    }
  }
  cout << op + 1 << endl;
  return 0;
}
