#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
long long MAX = 1e17;
int main() {
  ios_base::sync_with_stdio(0);
  ;
  int n, m, k;
  cin >> n >> m >> k;
  bool h[n + 1];
  int x;
  for (int i = 0; i <= n; ++i) {
    h[i] = 0;
  }
  for (int i = 0; i < m; ++i) {
    cin >> x;
    h[x] = 1;
  }
  int final = 1, y;
  if (h[1]) {
    cout << 1 << '\n';
    return 0;
  }
  for (int i = 0; i < k; ++i) {
    cin >> x >> y;
    if (final == x) {
      if (h[y]) {
        cout << y << '\n';
        return 0;
      } else
        final = y;
    } else if (final == y) {
      if (h[x]) {
        cout << x << '\n';
        return 0;
      } else
        final = x;
    }
  }
  cout << final << "\n";
  ;
  return 0;
}
