Score : $600$ points
You are given a simple undirected graph with $N$ vertices and $M$ edges. The $N$ vertices are called Vertex $1$, Vertex $2$, $\ldots$, Vertex $N$.
For each $i = 1, 2, \ldots, M$, the $i$-th edge connects Vertex $u_i$ and Vertex $v_i$.
Additionally, for each $i = 1, 2, \ldots, N$, Vertex $i$ has an integer $i$ written on it.
You are also given $Q$ queries.
For each $i = 1, 2, \ldots, Q$, the $i$-th query is represented as an integer $x_i$.
This query involves the following operation.
Here, Vertex $u$ and Vertex $v$ are said to be adjacent when there is an edge connecting them.
Print the integer written on each vertex after all queries are processed in the order they are given from input.
Input is given from Standard Input in the following format:
$N$ $M$ $Q$ $u_1$ $v_1$ $u_2$ $v_2$ $\vdots$ $u_M$ $v_M$ $x_1$ $x_2$ $\ldots$ $x_Q$
Print the integers written on the vertices after all queries are processed, in the format below, with spaces in between.
Here, for each $i = 1, 2, \ldots, N$, $A_i$ denotes the integer written on Vertex $i$.
$A_1$ $A_2$ $\ldots$ $A_N$
5 6 3 4 2 4 3 1 2 2 3 4 5 1 5 1 3 4
1 3 3 3 3
Each query involves the following operation.
14 14 8 7 4 13 9 9 8 4 3 7 2 13 8 12 8 11 3 6 3 7 14 6 5 1 4 10 13 5 2 2 6 12 9 1 10 5 4
1 6 1 1 6 6 1 9 9 10 11 12 10 14