#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const long long INFLL = 0x3f3f3f3f3f3f3f3fll;
const int maxn = 1e6 + 5;
const int mod = 1e9 + 7;
int n, m, k;
int h[maxn];
int uu[maxn], vv[maxn];
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < m; i++) {
    int x;
    scanf("%d", &x);
    h[x] = 1;
  }
  int now = 1;
  for (int i = 0; i < k; i++) {
    scanf("%d%d", &uu[i], &vv[i]);
  }
  for (int i = 0; i < k; i++) {
    int u, v;
    u = uu[i], v = vv[i];
    if (u == now) {
      if (h[v]) {
        now = v;
        break;
      } else {
        now = v;
      }
    } else if (v == now) {
      if (h[u]) {
        now = u;
        break;
      } else {
        now = u;
      }
    }
  }
  if (h[1])
    cout << 1 << endl;
  else
    cout << now << endl;
  return 0;
}
