#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <bitset>
#include <vector>
#include <algorithm>
#define MAX		1010

using namespace std;

typedef bitset < MAX > bit;

struct Node {
	bit child_union;
	bit child_intersection;
	vector < int > in;
	vector < int > out;
};

Node node[MAX];
bit enabled;
bool bio[MAX];
bool prosiren[MAX];
int n, m, k;


void DFS_reverse( int x ) {
	if ( bio[x] ) return;
	bio[x] = true;
	Node *p = node + x;
	
	bool first = true;
	static bit tmp;
	for ( vector < int >::iterator it = p->in.begin(); it != p->in.end(); ++it ) {
//		printf("%d back to %d\n", x, *it);
		DFS_reverse( *it );
		tmp = node[*it].child_union;
		tmp.set( *it );
		
		if ( first ) {
			p->child_union = tmp;
			p->child_intersection = tmp;
			first = false;
		} else {
			p->child_union |= tmp;
			p->child_intersection &= tmp;
		}
	}
}


int main(void) {
	int a, b;
	scanf("%d%d%d", &n, &m, &k);
	for ( int i = 0; i < m; ++i ) {
		scanf("%d%d", &a, &b);
		node[a].out.push_back( b );
		node[b].in.push_back( a );
	}
	
	for ( int i = 1; i <= n; ++i )
		DFS_reverse( i );
		
	enabled.reset();
	for ( int i = 0; i < k; ++i ) {
		scanf("%d", &a);
		enabled.set( a );
	}
	
/*	for ( int i = 1; i <= n; ++i ) {
		printf("%d -> ", i);
		printf("[");
		for ( int j = 1; j <= n; ++j )
			if ( node[i].child_union[j] )
				printf("%d ", j);
		printf("] [");
		for ( int j = 1; j <= n; ++j )
			if ( node[i].child_intersection[j] )
				printf("%d ", j);
		printf("]\n");
	}//*/

	bool changes;
	bit tmp;
	do {
		changes = false;
		
		for ( int i = 1; i <= n; ++i ) {
			if ( enabled[i] ) {
				if ( prosiren[i] ) continue;
//				tmp = node[i].child_intersection & ~enabled;
//				if ( tmp.none() ) continue;
				changes = true;
				prosiren[i] = true;
				enabled |= node[i].child_intersection;
			} else {
				if ( (node[i].child_union & enabled).any() ) {
					changes = true;
					enabled |= node[i].child_intersection;
					enabled.set( i );
					prosiren[i] = true;
				}
				
			}
		}
		
		
	} while ( changes );
	
	for ( int i = 1; i <= n; ++i )
		if ( enabled[i] )
			printf("%d ", i);
			
	printf("\n");
	return 0;
}
