#include <bits/stdc++.h>
void run() {
  int n, m, k;
  scanf("%d%d%d\n", &n, &m, &k);
  std::unordered_set<int> holes;
  holes.reserve(m);
  for (int i = 0; i < m; i++) {
    int curr;
    scanf("%d", &curr);
    curr--;
    holes.insert(curr);
  }
  scanf("\n");
  std::vector<std::pair<int, int> > swapv;
  swapv.reserve(k);
  for (int i = 0; i < k; i++) {
    int u, v;
    scanf("%d%d\n", &u, &v);
    u--;
    v--;
    swapv.push_back({u, v});
  }
  int bone_pos = 0;
  int final_pos;
  std::vector<int> path;
  path.reserve(k);
  path.push_back(bone_pos);
  for (int i = 0; i < k; i++) {
    if (bone_pos == swapv[i].first) {
      bone_pos = swapv[i].second;
      path.push_back(bone_pos);
    } else if (bone_pos == swapv[i].second) {
      bone_pos = swapv[i].first;
      path.push_back(bone_pos);
    }
  }
  for (int i = 0; i < path.size(); i++) {
    if (holes.find(path[i]) != holes.end()) {
      printf("%d", path[i] + 1);
      return;
    }
  }
  std::cout << (bone_pos + 1) << std::endl;
  return;
}
int main() {
  std::cout.sync_with_stdio(false);
  run();
  return 0;
}
