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 CPP):

Solution:
/**
>>> In The Name Of GOD
**/
#include <bits/stdc++.h>

using namespace std;

//freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);

///ifstream fin("input.txt");
///ofstream fout("output.txt");

vector <int> mark;

vector < vector <int> > adj;
vector < pair <int,int> > edge;
vector <int> h;

int dfs(int v)
{
    mark[v-1]=1;
    int m1,m2;
    m1=m2=h[v-1];
    //int check=1;
    for (auto i:adj[v-1])
        if (!mark[i-1])
        {
            h[i-1]=h[v-1]+1;
            int x=dfs(i);
           // if (v-1==3)
             //   cout << '#'<< x << ' ' << h[v-1] << endl;
            if ((x>h[v-1] || adj[i-1].size()==1))
            {
                edge.push_back(make_pair(min(i,v)-1,max(i,v)-1));
                //check=0;
            }
            m1=min(m1,x);
        }
        else
            if (h[i-1]!=h[v-1]-1)
                m2=min(m2,h[i-1]);

    return min(m1,m2);
}


int main()
{
    int n,i,m;
    cin >> n >> m;
    for (i=0;i<n;i++)
        mark.push_back(0), h.push_back(0), adj.push_back({});
    int x,y;
    for (i=0;i<m;i++)
        cin >> x >> y, adj[x].push_back(y+1), adj[y].push_back(x+1);
    dfs(1);
    sort(edge.begin(),edge.end());
    for (auto j:edge)
        cout << j.first << ' ' << j.second <<endl;
    return 0;
}