#include <bits/stdc++.h>
using namespace std;
const int N = 101000;
int n, m, k, ver[N];
vector<int> v[N];
int rez1, rez2 = 1, nr, nr1[N], nr2[N], poz;
bool vv[N], vv2[N];
struct classcomp {
  bool operator()(const int& a, const int& b) const {
    if ((1LL * nr1[a] * nr2[b]) == (1LL * nr1[b] * nr2[a])) return a < b;
    return (1LL * nr1[a] * nr2[b]) < (1LL * nr1[b] * nr2[a]);
  }
};
set<int, classcomp> h;
void df(int nod) {
  vv[nod] = 1;
  nr2[nod] = v[nod].size();
  for (vector<int>::iterator it = v[nod].begin(); it != v[nod].end(); ++it) {
    if (!ver[*it]) nr1[nod]++;
    if (!vv[*it]) df(*it);
  }
  if (!ver[nod]) h.insert(nod);
}
void calcrez() {
  int i;
  for (i = 1; i <= n; ++i)
    if (!vv[i]) {
      df(i);
    }
  int pc = 0;
  while (!h.empty()) {
    int el = *h.begin();
    h.erase(h.begin());
    if (1LL * nr1[el] * rez2 > 1LL * rez1 * nr2[el]) {
      poz = pc;
      rez1 = nr1[el];
      rez2 = nr2[el];
    }
    pc++;
    for (vector<int>::iterator it = v[el].begin(); it != v[el].end(); ++it)
      if (!ver[*it] && !vv2[*it]) {
        h.erase(h.find(*it));
        nr1[*it]--;
        h.insert(*it);
      }
    vv2[el] = 1;
  }
  memset(vv2, 0, sizeof(vv2));
  memset(vv, 0, sizeof(vv));
  memset(nr1, 0, sizeof(nr1));
  memset(nr2, 0, sizeof(nr2));
  for (i = 1; i <= n; ++i)
    if (!vv[i]) {
      df(i);
    }
  for (i = 1; i <= poz; ++i) {
    int el = *h.begin();
    h.erase(h.begin());
    for (vector<int>::iterator it = v[el].begin(); it != v[el].end(); ++it)
      if (!ver[*it] && !vv2[*it]) {
        h.erase(h.find(*it));
        nr1[*it]--;
        h.insert(*it);
      }
    vv2[el] = 1;
  }
  cout << h.size() << "\n";
  while (!h.empty()) {
    cout << *h.begin() << " ";
    h.erase(h.begin());
  }
}
int main() {
  int i;
  cin >> n >> m >> k;
  for (i = 1; i <= k; ++i) {
    int a;
    scanf("%d", &a);
    ver[a] = 1;
  }
  for (i = 1; i <= m; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    v[a].push_back(b);
    v[b].push_back(a);
  }
  calcrez();
  return 0;
}
