Bertown has *n* junctions and *m* bidirectional roads. We know that one can get from any junction to any other one by the existing roads. 

As there were more and more cars in the city, traffic jams started to pose real problems. To deal with them the government decided to make the traffic one-directional on all the roads, thus easing down the traffic. Your task is to determine whether there is a way to make the traffic one-directional so that there still is the possibility to get from any junction to any other one. If the answer is positive, you should also find one of the possible ways to orient the roads.
The first line contains two space-separated integers *n* and *m* (2 ≤ *n* ≤ 10<sup class="upper-index">5</sup>, *n* - 1 ≤ *m* ≤ 3·10<sup class="upper-index">5</sup>) which represent the number of junctions and the roads in the town correspondingly. Then follow *m* lines, each containing two numbers which describe the roads in the city. Each road is determined by two integers *a*<sub class="lower-index">*i*</sub> and *b*<sub class="lower-index">*i*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub>, *b*<sub class="lower-index">*i*</sub> ≤ *n*, *a*<sub class="lower-index">*i*</sub> ≠ *b*<sub class="lower-index">*i*</sub>) — the numbers of junctions it connects.

It is guaranteed that one can get from any junction to any other one along the existing bidirectional roads. Each road connects different junctions, there is no more than one road between each pair of junctions.
6 8
1 2
2 3
1 3
4 5
4 6
5 6
2 4
3 5
6 4
4 5
5 6
5 3
3 2
2 1
1 3
2 4
6 7
1 2
2 3
1 3
4 5
4 6
5 6
2 4
0
10 19
6 8
5 8
8 3
1 9
3 6
4 8
10 8
8 7
5 3
10 1
5 10
4 10
2 1
3 2
7 6
8 2
1 6
10 7
2 10
0
5 9
5 4
2 1
3 4
4 1
5 2
2 3
4 2
3 1
5 1
5 4
4 3
3 2
2 1
1 4
1 3
1 5
2 5
2 4
6 9
4 1
3 4
5 6
3 1
4 2
1 5
6 1
6 4
5 4
0
5 10
3 4
4 5
2 4
4 1
1 5
2 3
5 3
2 1
1 3
5 2
5 4
4 3
3 2
2 4
2 1
1 4
1 5
1 3
2 5
3 5
12 32
5 4
10 11
4 2
9 4
9 11
10 6
6 12
12 4
10 4
7 12
1 12
3 6
9 6
5 9
3 12
8 3
11 2
5 1
1 3
11 12
11 1
2 5
8 1
11 4
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1 5
4 6
3 4
6 1
1 3
3 6
3 4
4 2
2 6
4 5
5 6
5 1
4 1
4 6
14 30
11 6
11 13
1 4
2 14
3 8
6 4
3 14
5 8
10 6
6 12
7 13
12 10
3 12
2 5
5 13
14 5
11 3
7 3
1 13
12 9
9 11
11 14
4 7
9 6
13 8
7 5
8 9
2 8
4 8
5 12
14 2
2 5
5 8
8 3
3 14
3 12
12 6
6 11
11 13
13 7
7 3
7 4
4 1
1 13
4 6
4 8
7 5
13 5
13 8
11 3
11 9
9 12
9 6
9 8
11 14
6 10
10 12
12 5
8 2
5 14
15 54
4 9
14 9
3 1
5 8
2 7
1 6
10 12
10 9
15 3
10 13
7 10
5 1
12 8
13 15
4 5
4 8
14 12
7 4
15 7
7 6
5 6
3 11
10 3
13 3
15 10
2 8
15 2
4 2
2 6
14 2
6 4
8 10
1 12
10 14
10 4
3 14
9 7
8 9
7 12
5 9
14 13
13 8
4 3
6 12
11 15
7 14
14 5
5 7
8 15
15 6
6 11
14 15
3 12
8 11
15 3
3 1
1 6
6 7
7 2
2 8
8 5
5 1
5 4
4 9
9 14
14 12
12 10
10 9
10 13
13 15
13 3
13 14
13 8
10 7
10 3
10 15
10 8
10 14
10 4
12 8
12 1
12 7
12 6
12 3
14 2
14 3
14 7
14 5
14 15
9 7
9 8
9 5
4 8
4 7
4 2
4 6
4 3
5 6
5 7
8 15
8 11
11 3
11 15
11 6
2 15
2 6
7 15
6 15
21 78
12 2
21 13
17 5
11 1
12 17
12 7
21 8
16 18
3 2
5 10
6 7
13 8
3 16
20 7
16 1
17 20
2 13
21 17
9 19
19 11
12 14
2 17
6 12
6 13
7 18
18 13
3 12
17 8
16 19
21 9
17 10
12 16
8 10
12 15
14 13
5 7
13 7
3 5
4 2
18 14
4 5
19 7
19 5
14 7
5 14
16 13
11 18
13 1
9 15
11 12
13 5
17 11
10 14
15 6
13 3
13 19
1 19
18 8
9 7
3 21
10 21
12 1
16 11
21 1
13 12
12 8
14 4
5 11
20 4
9 16
6 21
19 20
10 4
4 17
7 2
5 6
2 5
11 9
21 13
13 8
8 21
8 17
17 5
5 10
10 17
10 8
10 14
14 12
12 2
2 3
3 16
16 18
18 7
7 12
7 6
6 12
6 13
6 15
15 12
15 9
9 19
19 11
11 1
1 16
1 13
1 19
1 12
1 21
11 18
11 12
11 17
11 16
11 5
11 9
19 16
19 7
19 5
19 13
19 20
20 7
20 17
20 4
4 2
4 5
4 14
4 10
4 17
9 21
9 7
9 16
6 21
6 5
7 5
7 13
7 14
7 2
18 13
18 14
18 8
16 12
16 13
3 12
3 5
3 13
3 21
2 13
2 17
2 5
12 17
12 13
12 8
14 13
14 5
10 21
5 13
17 21
18 75
17 1
13 18
15 11
6 3
18 16
9 18
6 15
6 14
10 7
17 16
12 6
15 13
5 1
4 13
8 1
11 5
16 9
3 2
4 16
4 18
12 9
8 11
5 18
5 3
7 11
2 11
14 16
16 15
13 6
10 8
6 7
7 4
12 16
1 14
8 4
11 17
3 7
3 8
14 4
7 17
13 9
9 7
17 13
4 6
6 5
5 16
18 3
4 3
8 18
6 16
7 18
9 3
17 5
2 5
16 7
15 7
12 4
5 4
1 16
1 7
11 3
5 10
13 5
4 10
9 5
8 13
10 18
3 15
16 10
5 12
2 7
18 12
10 3
8 15
10 1
18 13
13 15
15 11
11 5
5 1
1 17
17 16
16 18
16 9
9 18
9 12
12 6
6 3
3 2
2 11
2 5
2 7
7 10
10 8
8 1
8 11
8 4
4 13
4 16
4 18
4 7
4 14
14 6
14 16
14 1
4 6
4 3
4 12
4 5
4 10
8 3
8 18
8 13
8 15
10 5
10 18
10 16
10 3
10 1
7 11
7 6
7 3
7 17
7 9
7 18
7 16
7 15
7 1
3 5
3 18
3 9
3 11
3 15
6 15
6 13
6 5
6 16
12 16
12 5
12 18
9 13
9 5
16 15
16 5
16 1
17 11
17 13
17 5
5 18
5 13
14 30
11 6
11 13
1 4
2 14
3 8
6 4
3 14
5 8
10 6
6 12
7 13
12 10
3 12
2 5
5 13
14 5
11 3
7 3
1 13
12 9
9 11
11 14
4 7
9 6
13 8
7 5
8 9
2 8
4 8
5 12
14 2
2 5
5 8
8 3
3 14
3 12
12 6
6 11
11 13
13 7
7 3
7 4
4 1
1 13
4 6
4 8
7 5
13 5
13 8
11 3
11 9
9 12
9 6
9 8
11 14
6 10
10 12
12 5
8 2
5 14
14 28
8 9
8 4
3 11
12 6
14 2
9 6
8 3
12 10
2 8
3 14
5 7
5 8
7 4
3 7
11 14
13 11
8 13
11 9
5 13
5 2
5 14
3 12
7 13
6 11
6 4
12 5
6 10
1 13
0
15 54
4 9
14 9
3 1
5 8
2 7
1 6
10 12
10 9
15 3
10 13
7 10
5 1
12 8
13 15
4 5
4 8
14 12
7 4
15 7
7 6
5 6
3 11
10 3
13 3
15 10
2 8
15 2
4 2
2 6
14 2
6 4
8 10
1 12
10 14
10 4
3 14
9 7
8 9
7 12
5 9
14 13
13 8
4 3
6 12
11 15
7 14
14 5
5 7
8 15
15 6
6 11
14 15
3 12
8 11
15 3
3 1
1 6
6 7
7 2
2 8
8 5
5 1
5 4
4 9
9 14
14 12
12 10
10 9
10 13
13 15
13 3
13 14
13 8
10 7
10 3
10 15
10 8
10 14
10 4
12 8
12 1
12 7
12 6
12 3
14 2
14 3
14 7
14 5
14 15
9 7
9 8
9 5
4 8
4 7
4 2
4 6
4 3
5 6
5 7
8 15
8 11
11 3
11 15
11 6
2 15
2 6
7 15
6 15
21 78
12 2
21 13
17 5
11 1
12 17
12 7
21 8
16 18
3 2
5 10
6 7
13 8
3 16
20 7
16 1
17 20
2 13
21 17
9 19
19 11
12 14
2 17
6 12
6 13
7 18
18 13
3 12
17 8
16 19
21 9
17 10
12 16
8 10
12 15
14 13
5 7
13 7
3 5
4 2
18 14
4 5
19 7
19 5
14 7
5 14
16 13
11 18
13 1
9 15
11 12
13 5
17 11
10 14
15 6
13 3
13 19
1 19
18 8
9 7
3 21
10 21
12 1
16 11
21 1
13 12
12 8
14 4
5 11
20 4
9 16
6 21
19 20
10 4
4 17
7 2
5 6
2 5
11 9
21 13
13 8
8 21
8 17
17 5
5 10
10 17
10 8
10 14
14 12
12 2
2 3
3 16
16 18
18 7
7 12
7 6
6 12
6 13
6 15
15 12
15 9
9 19
19 11
11 1
1 16
1 13
1 19
1 12
1 21
11 18
11 12
11 17
11 16
11 5
11 9
19 16
19 7
19 5
19 13
19 20
20 7
20 17
20 4
4 2
4 5
4 14
4 10
4 17
9 21
9 7
9 16
6 21
6 5
7 5
7 13
7 14
7 2
18 13
18 14
18 8
16 12
16 13
3 12
3 5
3 13
3 21
2 13
2 17
2 5
12 17
12 13
12 8
14 13
14 5
10 21
5 13
17 21
15 54
4 9
14 9
3 1
5 8
2 7
1 6
10 12
10 9
15 3
10 13
7 10
5 1
12 8
13 15
4 5
4 8
14 12
7 4
15 7
7 6
5 6
3 11
10 3
13 3
15 10
2 8
15 2
4 2
2 6
14 2
6 4
8 10
1 12
10 14
10 4
3 14
9 7
8 9
7 12
5 9
14 13
13 8
4 3
6 12
11 15
7 14
14 5
5 7
8 15
15 6
6 11
14 15
3 12
8 11
15 3
3 1
1 6
6 7
7 2
2 8
8 5
5 1
5 4
4 9
9 14
14 12
12 10
10 9
10 13
13 15
13 3
13 14
13 8
10 7
10 3
10 15
10 8
10 14
10 4
12 8
12 1
12 7
12 6
12 3
14 2
14 3
14 7
14 5
14 15
9 7
9 8
9 5
4 8
4 7
4 2
4 6
4 3
5 6
5 7
8 15
8 11
11 3
11 15
11 6
2 15
2 6
7 15
6 15
14 28
8 9
8 4
3 11
12 6
14 2
9 6
8 3
12 10
2 8
3 14
5 7
5 8
7 4
3 7
11 14
13 11
8 13
11 9
5 13
5 2
5 14
3 12
7 13
6 11
6 4
12 5
6 10
1 13
0
18 75
17 1
13 18
15 11
6 3
18 16
9 18
6 15
6 14
10 7
17 16
12 6
15 13
5 1
4 13
8 1
11 5
16 9
3 2
4 16
4 18
12 9
8 11
5 18
5 3
7 11
2 11
14 16
16 15
13 6
10 8
6 7
7 4
12 16
1 14
8 4
11 17
3 7
3 8
14 4
7 17
13 9
9 7
17 13
4 6
6 5
5 16
18 3
4 3
8 18
6 16
7 18
9 3
17 5
2 5
16 7
15 7
12 4
5 4
1 16
1 7
11 3
5 10
13 5
4 10
9 5
8 13
10 18
3 15
16 10
5 12
2 7
18 12
10 3
8 15
10 1
18 13
13 15
15 11
11 5
5 1
1 17
17 16
16 18
16 9
9 18
9 12
12 6
6 3
3 2
2 11
2 5
2 7
7 10
10 8
8 1
8 11
8 4
4 13
4 16
4 18
4 7
4 14
14 6
14 16
14 1
4 6
4 3
4 12
4 5
4 10
8 3
8 18
8 13
8 15
10 5
10 18
10 16
10 3
10 1
7 11
7 6
7 3
7 17
7 9
7 18
7 16
7 15
7 1
3 5
3 18
3 9
3 11
3 15
6 15
6 13
6 5
6 16
12 16
12 5
12 18
9 13
9 5
16 15
16 5
16 1
17 11
17 13
17 5
5 18
5 13
14 28
8 9
8 4
3 11
12 6
14 2
9 6
8 3
12 10
2 8
3 14
5 7
5 8
7 4
3 7
11 14
13 11
8 13
11 9
5 13
5 2
5 14
3 12
7 13
6 11
6 4
12 5
6 10
1 13
0
5 5
1 2
2 3
3 1
1 4
3 5
0
6 7
1 2
2 3
3 1
1 4
3 5
5 6
6 3
0
7 9
1 2
2 3
3 1
1 4
4 7
7 1
3 5
5 6
6 3
7 4
4 1
1 2
2 3
3 1
3 5
5 6
6 3
1 7
9 12
2 8
2 9
9 8
1 2
2 3
3 1
1 4
4 7
7 1
3 5
5 6
6 3
9 2
2 8
8 9
2 1
1 3
3 2
3 5
5 6
6 3
1 4
4 7
7 1
2 1
1 2
0
3 2
2 1
2 3
0
3 3
1 2
1 3
3 2
3 1
1 2
2 3
4 3
1 2
2 3
3 4
0
4 4
1 2
2 3
3 4
4 1
4 3
3 2
2 1
1 4
4 4
1 2
2 3
3 4
4 2
0
4 4
3 1
1 2
2 4
4 1
0
4 3
4 1
4 2
4 3
0
4 5
1 2
2 3
3 1
3 4
4 1
4 3
3 2
2 1
1 3
1 4
4 5
1 2
2 3
3 4
4 1
2 4
4 3
3 2
2 1
1 4
2 4
4 6
1 2
2 3
3 4
4 1
1 3
4 2
4 3
3 2
2 1
1 4
1 3
2 4
15 54
4 9
14 9
3 1
5 8
2 7
1 6
10 12
10 9
15 3
10 13
7 10
5 1
12 8
13 15
4 5
4 8
14 12
7 4
15 7
7 6
5 6
3 11
10 3
13 3
15 10
2 8
15 2
4 2
2 6
14 2
6 4
8 10
1 12
10 14
10 4
3 14
9 7
8 9
7 12
5 9
14 13
13 8
4 3
6 12
11 15
7 14
14 5
5 7
8 15
15 6
6 11
14 15
3 12
8 11
15 3
3 1
1 6
6 7
7 2
2 8
8 5
5 1
5 4
4 9
9 14
14 12
12 10
10 9
10 13
13 15
13 3
13 14
13 8
10 7
10 3
10 15
10 8
10 14
10 4
12 8
12 1
12 7
12 6
12 3
14 2
14 3
14 7
14 5
14 15
9 7
9 8
9 5
4 8
4 7
4 2
4 6
4 3
5 6
5 7
8 15
8 11
11 3
11 15
11 6
2 15
2 6
7 15
6 15
21 78
12 2
21 13
17 5
11 1
12 17
12 7
21 8
16 18
3 2
5 10
6 7
13 8
3 16
20 7
16 1
17 20
2 13
21 17
9 19
19 11
12 14
2 17
6 12
6 13
7 18
18 13
3 12
17 8
16 19
21 9
17 10
12 16
8 10
12 15
14 13
5 7
13 7
3 5
4 2
18 14
4 5
19 7
19 5
14 7
5 14
16 13
11 18
13 1
9 15
11 12
13 5
17 11
10 14
15 6
13 3
13 19
1 19
18 8
9 7
3 21
10 21
12 1
16 11
21 1
13 12
12 8
14 4
5 11
20 4
9 16
6 21
19 20
10 4
4 17
7 2
5 6
2 5
11 9
21 13
13 8
8 21
8 17
17 5
5 10
10 17
10 8
10 14
14 12
12 2
2 3
3 16
16 18
18 7
7 12
7 6
6 12
6 13
6 15
15 12
15 9
9 19
19 11
11 1
1 16
1 13
1 19
1 12
1 21
11 18
11 12
11 17
11 16
11 5
11 9
19 16
19 7
19 5
19 13
19 20
20 7
20 17
20 4
4 2
4 5
4 14
4 10
4 17
9 21
9 7
9 16
6 21
6 5
7 5
7 13
7 14
7 2
18 13
18 14
18 8
16 12
16 13
3 12
3 5
3 13
3 21
2 13
2 17
2 5
12 17
12 13
12 8
14 13
14 5
10 21
5 13
17 21
4 5
4 1
1 2
1 3
2 3
3 4
4 1
1 2
2 3
3 1
3 4
from collections import deque
import heapq
mod = 1000000007
time = 0

def solve():
	n,m = map(int,input().split())
	adj = [[]for i in range(n+1)]
	for i in range(m):
		a,b = map(int,input().split())
		adj[a].append(b)
		adj[b].append(a)

	def bridge(s,par):
		global time
		disc[s] = time
		low[s] = time
		time+=1

		for i in adj[s]:
			if disc[i] == -1:
				ans.append((s,i))
				if bridge(i,s):
					return True
				low[s] = min(low[s],low[i])
				if low[i]>disc[s]:
					return True
			elif i!=par:
				if low[s]>disc[i]:
					low[s] = disc[i]
					ans.append((s,i))
	ans = []
	low = [-1]*(n+1)
	disc = [-1]*(n+1)
	if bridge(1,-1):
		print(0)
	else:
		for i in ans:
			print(*i)






















t = 1
#t = int(input())

for i in range(t):
	solve()