Vasya's graph

아직 제출이 없습니다시간 제한2초메모리 제한256 MB

문제

Vasya has got a graph. The graph has NN nodes, but it's got no eges yet. Vasya cares a lot about the future graph structure: he knows KK pairs of nodes {u_ju\_j, v_jv\_j}, such that if there is a path between these nodes in the graph, the irredeemable will happen to the graph. Vasya must prevent it at all costs.

Vasya has made a list of MM unoriented edges. Vasya will examine the edges in the preset order and he will surely put them into the graph, if possible. If adding another edge will cause the irredeemable, Vasya will simply discard such an edge. Your task is to find out which edges are good for the graph and which ones must end up in the trash.

입력

The first line of the input file contains three integers NN, KK and MM (1N1051 \leq N \leq 10^5, 0K,M1050 \leq K, M \leq 10^5).

It is followed by KK lines, with the ii-th line containing two integers u_iu\_i and v_iv\_i  --- the numbers of conflicting nodes, which should not have any edges between them (1u_i<v_iN1 \leq u\_i < v\_i \leq N). The conflicting node pairs are unique.

Next come MM lines with the ii-th line containing two integers u~_i\tilde u\_i and v~_i\tilde v\_i  --- the numbers of nodes of the edge which can be added to the graph (1u~_i<v~_iN1 \leq \tilde u\_i < \tilde v\_i \leq N). These edges are provided in the order of examination. Edges in the list are unique.

출력

The first line of the output file must contain the number of edges that Vasya can accomodate into the graph. The second line must contain space-separated numbers of edges in the ascending order.