#include <bits/stdc++.h>
using namespace std;
const int INF = (int)2e9;
const long long INFL = (long long)9e18;
const int MAXINT = ((~0) ^ (1 << 31));
const long long MAXLL = ((~0) ^ ((long long)1 << 63));
template <class T>
inline T pow2(T a) {
  return a * a;
}
template <class T>
inline bool mineq(T& a, T b) {
  return (a > b) ? (a = b, true) : false;
}
template <class T>
inline bool maxeq(T& a, T b) {
  return (a < b) ? (a = b, true) : false;
}
const int maxn = (int)1e5 + 10;
;
const int MOD = (int)1e9 + 7;
;
const long double eps = 1e-12;
int n, m, k, visited[maxn], bad[maxn];
vector<int> f, adj[maxn], ans;
struct cmp {
  bool operator()(const int& a, const int& b) {
    if ((long long)bad[a] * (long long)adj[b].size() !=
        (long long)bad[b] * (long long)adj[a].size()) {
      return (long long)bad[a] * (long long)adj[b].size() >
             (long long)bad[b] * (long long)adj[a].size();
    } else
      return a < b;
  }
};
set<int, cmp> st;
pair<int, int> best = make_pair(1, 1);
void relax(int v) {
  visited[v] = true;
  for (int i = 0; i < (int)(adj[v].size()); i++) {
    int u = adj[v][i];
    if (!visited[u]) {
      st.erase(u);
      bad[u]++;
      st.insert(u);
    }
  }
}
void solve(pair<int, int> mx) {
  st.clear();
  ans.clear();
  fill(visited, visited + maxn, 0);
  fill(bad, bad + maxn, 0);
  for (int i = 0; i < (int)(f.size()); i++) {
    visited[f[i]] = true;
    bad[f[i]] = adj[f[i]].size();
  }
  for (int i = 1; i < (int)(n + 1); i++) st.insert(i);
  while (!st.empty()) {
    int v = *st.begin();
    st.erase(st.begin());
    if ((long long)bad[v] * (long long)best.second <
        (long long)best.first * (long long)adj[v].size()) {
      best = make_pair(bad[v], adj[v].size());
    }
    if ((long long)bad[v] * (long long)mx.second <=
        (long long)mx.first * (long long)adj[v].size())
      break;
    relax(v);
  }
  for (int i = 1; i < (int)(n + 1); i++)
    if (!visited[i]) ans.push_back(i);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m >> k;
  for (int i = 0; i < (int)(k); i++) {
    int a;
    cin >> a;
    f.push_back(a);
  }
  for (int i = 0; i < (int)(m); i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  solve(make_pair(0, 1));
  solve(best);
  cout << ans.size() << endl;
  for (int i = 0; i < (int)(ans.size()); i++) cout << ans[i] << " ";
}
