Consider a directed graph consisting of nodes and directed edges. Nodes are numbered from to and edges are numbered from to . Let's select some node as the starting one and find all nodes that are reachable from by moving along edges (denote this set as C_0). Define as the set of nodes which are reachable from using any edges except the one with number . Edge is called redundant if is equal to C_0.
You are given the graph and the starting node . Your goal is to find all redundant edges.
The first line contains three integers , and (1 \leq n \leq 100000, 1 \leq m \leq 200000, 1 \leq r \leq n): the number of nodes, the number of edges and the starting node, respectively. Next lines describe the edges of the graph: -th of them contains two integers a_i and b_i (1 \leq a_i, b_i \leq n) which introduce a directed edge from node a_i to node b_i. It is guaranteed that there are no loops, and for any two nodes and , there is at most one edge from to .
On the first line, print the number of redundant edges. On the second line, print the numbers of all redundant edges in any order. Edges are numbered starting from according to their order in the input.
Example 1
Example 2