n,k,x = map(int,input().split()) res = list(range(1,n+1)) for _ in range(x-1): a,b = map(int,input().split()) res[a-1],res[b-1] = res[b-1],res[a-1] input() ab = [list(map(int,input().split())) for _ in range(k-x)] *c, = map(int,input().split()) for a,b in ab[::-1]: c[a-1],c[b-1] = c[b-1],c[a-1] print(*[i+1 for i in range(n) if res[i] != c[i]])