#include <bits/stdc++.h>
using namespace std;
auto pi = new char[10000000];
auto po = new char[10000000];
auto po0 = po;
int ru() {
while (!isdigit(*pi)) {
pi++;
}
int res = 0;
while (isdigit(*pi)) {
res *= 10;
res += *pi - '0';
pi++;
}
return res;
}
void wc(char c) {
*po++ = c;
}
void wu(int i) {
int x = 1;
int c = 1;
while (x <= i / 10) {
x *= 10;
c++;
}
while (c--) {
int d = i / x;
wc('0' + d);
i -= d * x;
i *= 10;
}
}
signed main() {
ios::sync_with_stdio(0);
cin.tie(0);
#ifdef CB
freopen("be2.txt","r",stdin);
// freopen("out.txt","w",stdout);
#endif
fread(pi,1,10000000,stdin);
int N=ru(),M=ru(),K=ru();
int it=N*2+2;
vector<int>v(N+1,-1);
deque<int>q;
for(int i=0;i<K;i++){
int a=ru();
v[a]=0;
q.push_back(a);
}
vector<vector<int>>g(N+1);
for(int i=0;i<M;i++){
int a=ru(),b=ru();
g[a].push_back(b);
g[b].push_back(a);
}
while(!q.empty()){
int i=q.front();
q.pop_front();
for(int j:g[i]){
if(v[j]==-1){
v[j]=v[i]+1;
q.push_back(j);
}
}
}
vector<vector<int>>d(it);
vector<int>w(N+1,-1);
for(int i=1;i<=N;i++){
if(v[i]==-1){
continue;
}
int x=INT_MAX;
for(int j:g[i]){
if(v[j]>=v[i]&&v[j]%2==v[i]%2){
x=min(x,v[j]);
}
}
if(x!=INT_MAX){
w[i]=x;
d[x].push_back(i);
}
}
for(int i=0;i<it;i++){
for(int j:d[i]){
if(w[j]<i){
continue;
}
for(int k:g[j]){
if(w[k]==-1||w[k]>i+1){
w[k]=i+1;
d[i+1].push_back(k);
}
}
}
}
vector<array<int,2>>b(it);
vector<int>pf(it);
int e=0;
for(int i=1;i<=N;i++){
if(v[i]==-1){
continue;
}
if (g[i].empty()){
e++;
continue;
}
b[v[i]][v[i]%2]++;
if(w[i]==-1){
continue;
}
b[w[i]][v[i]%2]--;
pf[w[i]]++;
}
vector<int>ans(it);
array<int,2>c{};
for(int i=0;i<it;i++){
c[0]+=b[i][0]+pf[i];
c[1]+=b[i][1]+pf[i];
ans[i]=c[i%2];
}
ans[0]+=e;
int P=max_element(ans.begin(),ans.end())-ans.begin();
wu(ans[P]);wc('\n');
wu(P+1);wc('\n');
for(int i=0;i<=P;i++){
wu(ans[i]);wc(' ');
}
wc('\n');
fwrite(po0,1,po-po0,stdout);
return 0;
}