#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const int N = 1e6 + 100;
const int MAX = 1e9 + 1;
int n, m, k;
int mp[N];
int a[N], b[N];
int main() {
  int i, j;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 0; i < m; ++i) {
    int t;
    scanf("%d", &t);
    mp[t] = 1;
  }
  for (i = 0; i < k; ++i) {
    scanf("%d%d", a + i, b + i);
  }
  int ans = 1;
  if (mp[1]) {
    ans = 1;
  } else {
    for (i = 0; i < k; ++i) {
      if (a[i] == ans) {
        if (mp[b[i]]) {
          ans = b[i];
          break;
        }
        ans = b[i];
      } else if (b[i] == ans) {
        if (mp[a[i]]) {
          ans = a[i];
          break;
        }
        ans = a[i];
      }
    }
  }
  cout << ans << endl;
  return 0;
}
