#include <bits/stdc++.h>
using namespace std;
const int mx = 1e5 + 10;
set<pair<double, int> > s[mx], test;
set<pair<double, int> >::iterator it;
vector<int> g[mx];
int n, m, k, vis[mx], cc1[mx], cc2[mx], val[mx];
void dfs(int u, int ss) {
  vis[u] = 1;
  int cnt = 0;
  for (int i = int(0); i <= int(g[u].size() - 1); ++i) {
    int v = g[u][i];
    if (vis[v]) {
      if (vis[v] == 2) cnt++;
      continue;
    }
    dfs(v, ss);
  }
  cc1[u] = cc2[u] = g[u].size() - cnt;
  double put = (1.0 * cc1[u]) / (1.0 * g[u].size());
  s[ss].insert(make_pair(put, u));
}
pair<double, int> process2(set<pair<double, int> > &test, int lim, int vv,
                           int cc[]) {
  double chk = 0;
  int bi = 0;
  for (int i = 1; i <= lim; ++i) {
    it = test.begin();
    int u = it->second;
    test.erase(it);
    val[u] = vv;
    for (int j = int(0); j <= int(g[u].size() - 1); ++j) {
      int v = g[u][j];
      if (val[v] == 1 or val[v] == vv) continue;
      double put = (1.0 * cc[v]) / (1.0 * g[v].size());
      test.erase(make_pair(put, v));
      cc[v]--;
      put = (1.0 * cc[v]) / (1.0 * g[v].size());
      test.insert(make_pair(put, v));
    }
    if (test.begin()->first >= chk) chk = test.begin()->first, bi = i;
  }
  return make_pair(chk, bi);
}
double process(int idx) {
  test = s[idx];
  pair<double, int> get = process2(test, test.size(), 100, cc1);
  if (get.first > s[idx].begin()->first) process2(s[idx], get.second, 200, cc2);
  return s[idx].begin()->first;
}
int main() {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = int(1); i <= int(k); ++i) {
    int in;
    scanf("%d", &in);
    vis[in] = 2, val[in] = 1;
  }
  for (int i = int(1); i <= int(m); ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int ncmp = 0, idx = 0;
  double ans = 0;
  for (int i = int(1); i <= int(n); ++i) {
    if (vis[i]) continue;
    ncmp++;
    dfs(i, ncmp);
    double get = process(ncmp);
    if (get >= ans) ans = get, idx = ncmp;
  }
  cout << s[idx].size() << endl;
  it = s[idx].begin();
  for (; it != s[idx].end(); ++it) cout << it->second << ' ';
  cout << endl;
  return 0;
}
