#include <bits/stdc++.h>
using namespace std;
struct city {
  pair<int, int> rate;
  int id;
  bool operator<(const city& r) const {
    return 1LL * rate.first * r.rate.second > 1LL * r.rate.first * rate.second;
  }
} c[100100];
bool better(pair<int, int> a, pair<int, int> b) {
  return 1LL * a.first * b.second > 1LL * a.second * b.first;
}
vector<int> g[100100];
vector<int> ch;
bool fort[100100];
bool vis[100100], tdel[100100];
priority_queue<city> pq;
void DFS(int u) {
  vis[u] = true;
  pq.push(c[u]);
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (!vis[v] && !fort[v]) DFS(v);
  }
}
int main() {
  int n, m, k;
  pair<int, int> ans(0, 1);
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) {
    c[i].rate = make_pair(0, 0);
    c[i].id = i;
  }
  for (int i = 0; i < k; i++) {
    int x;
    scanf("%d", &x);
    fort[x] = true;
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
    c[x].rate.second++, c[y].rate.second++;
    if (!fort[x]) c[y].rate.first++;
    if (!fort[y]) c[x].rate.first++;
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i] && !fort[i]) {
      DFS(i);
      pair<int, int> tmp(0, 1);
      vector<int> del;
      while (!pq.empty()) {
        city now = pq.top();
        pq.pop();
        if (now.rate != c[now.id].rate) continue;
        if (better(now.rate, tmp)) {
          tmp = now.rate;
          del.clear();
        }
        del.push_back(now.id);
        tdel[now.id] = true;
        for (int i = 0; i < g[now.id].size(); i++) {
          int v = g[now.id][i];
          if (!fort[v] && !tdel[v]) {
            c[v].rate.first--;
            pq.push(c[v]);
          }
        }
      }
      if (!better(ans, tmp)) {
        ans = tmp;
        ch = del;
      }
    }
  }
  printf("%d\n", ch.size());
  for (int i = 0; i < ch.size(); i++) printf("%d ", ch[i]);
  puts("");
  return 0;
}
