Problem: Find bridges of an undirected graph G(V, E).

A bridge (also known as a cut-edge) is an edge whose deletion increase the number of connected components.

Constraints

* 1 ≤ |V| ≤ 100,000
* 0 ≤ |E| ≤ 100,000
* The graph is connected
* There are no parallel edges
* There are no self-loops

Input


|V| |E|
s0 t0
s1 t1
:
s|E|-1 t|E|-1


, where |V| is the number of nodes and |E| is the number of edges in the graph. The graph nodes are named with the numbers 0, 1,..., |V|-1 respectively.

si and ti represent source and target nodes of i-th edge (undirected).

Output

A list of bridges of the graph ordered by name. For each bridge, names of its end-ponints, source and target (source < target), should be printed separated by a space. The sources should be printed ascending order, then the target should also be printed ascending order for the same source.

Examples

Input

4 4
0 1
0 2
1 2
2 3


Output

2 3


Input

5 4
0 1
1 2
2 3
3 4


Output

0 1
1 2
2 3
3 4

Solution (in PYTHON3):

Solution:
# AOJ GRL_3_B
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_3_B

import sys

sys.setrecursionlimit(100000)

V, E = list(map(int, input().split()))
Edge = [list(map(int, input().split())) for _ in range(0, E)]

ord = [0 for _ in range(0, V)]
low = [0 for _ in range(0, V)]
used = [False for _ in range(0, V)]
bridge = []

G = [ [] for _ in range(0, V)]
for s, t in Edge:
    G[s] += [t]
    G[t] += [s]

# pは親となる頂点
def dfs(s, p, k):
    global articulation
    used[s] = True
    ord[s] = k
    low[s] = ord[s]
    k += 1
    c = 0
    
    # sから始まる辺
    for t in G[s]:
        # まだ探索していないか
        if used[t] == False:
            c += 1
            dfs(t, s, k)
            # DFSの葉の方向進める頂点のlowlinkの最小値
            low[s] = min(low[s], low[t])
        # 後退辺か
        elif t != p:
            # ord[t]の最小値
            low[s] = min(low[s], ord[t])

for s in range(0, V): 
    if used[s] == False:
        dfs(s, -1, 0)

for s, t in Edge:
    if ord[s] < low[t] or ord[t] < low[s]:
        if s < t:
            bridge += [(s, t)]
        else:
            bridge += [(t, s)]

bridge.sort()
for s, t in bridge:
    print(s, t)