#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
typedef pair <int, int> pii;

const int INF = 0x3f3f3f3f;
int n, e, t1, t2, timer, st[100005], nd[100005], low[100005];
vector <int> v[100005];
vector <pii> b;

void dfs(int node, int p) {
	st[node] = timer++;
	low[node] = st[node];
	for (int i : v[node]) {
		if (i == p) continue;
		if (st[i] == INF) {
			dfs(i, node);
			low[node] = min(low[node], low[i]);
			if (low[i] > st[node]) {
				b.push_back(make_pair(i, node));
			}
		}
		else if (nd[i] == INF) {
			low[node] = min(low[node], low[i]);
		}
	}
	nd[node] = timer;
}

int main() {
	cin >> n >> e;
	for (int i = 0; i < n; i++) st[i] = INF, nd[i] = INF;
	for (int i = 0; i < e; i++) {
		cin >> t1 >> t2;
		v[t1].push_back(t2);
		v[t2].push_back(t1);
	}
	dfs(0, -1);
//	for (int i = 0; i < n; i++) {
//		cout << st[i] << ' ' << nd[i] << ' ' << low[i] << endl;
//	}
	for (int i = 0; i < b.size(); i++) if (b[i].fi > b[i].se) swap(b[i].fi, b[i].se);
	sort(b.begin(), b.end());
	for (int i = 0; i < b.size(); i++) cout << b[i].fi << ' ' << b[i].se << endl;
	return 0;
}


