Problem: Berland is a tourist country! At least, it can become such — the government of Berland is confident about this. 

There are n cities in Berland, some pairs of which are connected by two-ways roads. Each road connects two different cities. In Berland there are no roads which connect the same pair of cities. It is possible to get from any city to any other city using given two-ways roads. 

According to the reform each road will become one-way. It will be oriented to one of two directions.

To maximize the tourist attraction of Berland, after the reform for each city i the value ri will be calculated. It will equal to the number of cities x for which there is an oriented path from the city i to the city x. In other words, ri will equal the number of cities which can be reached from the city i by roads. 

The government is sure that tourist's attention will be focused on the minimum value of ri.

Help the government of Berland make the reform to maximize the minimum of ri.

Input

The first line contains two integers n, m (2 ≤ n ≤ 400 000, 1 ≤ m ≤ 400 000) — the number of cities and the number of roads. 

The next m lines describe roads in Berland: the j-th of them contains two integers uj and vj (1 ≤ uj, vj ≤ n, uj ≠ vj), where uj and vj are the numbers of cities which are connected by the j-th road.

The cities are numbered from 1 to n. It is guaranteed that it is possible to get from any city to any other by following two-ways roads. In Berland there are no roads which connect the same pair of cities. 

Output

In the first line print single integer — the maximum possible value min1 ≤ i ≤ n{ri} after the orientation of roads. 

The next m lines must contain the description of roads after the orientation: the j-th of them must contain two integers uj, vj, it means that the j-th road will be directed from the city uj to the city vj. Print roads in the same order as they are given in the input data. 

Example

Input

7 9
4 3
2 6
7 1
4 1
7 3
3 5
7 4
6 5
2 5


Output

4
4 3
6 2
7 1
1 4
3 7
5 3
7 4
5 6
2 5

Solution (in JAVA):

Solution:
// practice with rainboy
import java.io.*;
import java.util.*;

public class CF732F extends PrintWriter {
	CF732F() { super(System.out); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF732F o = new CF732F(); o.main(); o.flush();
	}

	int[] next, hh; int $ = 1;
	int[] ii, jj, ao, ao_;
	int[] dsu;
	int[] hh_; int cnt;
	int[] ta, tb; int time;
	int link(int l, int h) {
		next[$] = l; hh[$] = h;
		return $++;
	}
	void init(int n, int m) {
		next = new int[1 + (m + n - 1) * 2]; hh = new int[1 + (m + n - 1) * 2];
		ii = new int[m]; jj = new int[m];
		ao = new int[n]; ao_ = new int[n];
		dsu = new int[n]; Arrays.fill(dsu, -1);
		hh_ = new int[n - 1];
		ta = new int[n]; tb = new int[n];
	}
	int find(int i) {
		return dsu[i] < 0 ? i : (dsu[i] = find(dsu[i]));
	}
	void join(int i, int j) {
		i = find(i);
		j = find(j);
		if (i == j)
			return;
		if (dsu[i] > dsu[j]) {
			dsu[j] += dsu[i];
			dsu[i] = j;
		} else {
			dsu[i] += dsu[j];
			dsu[j] = i;
		}
	}
	void dfs(int h_, int i) {
		ta[i] = tb[i] = ++time;
		for (int l = ao[i]; l != 0; l = next[l]) {
			int h = hh[l];
			if (h != h_) {
				int j = i ^ ii[h] ^ jj[h];
				if (ta[j] == 0) {
					ii[h] = i; jj[h] = j;
					dfs(h, j);
					tb[i] = Math.min(tb[i], tb[j]);
					if (tb[j] == ta[j])
						hh_[cnt++] = h;
					else
						join(i, j);
				} else if (ta[j] < ta[i]) {
					ii[h] = i; jj[h] = j;
					tb[i] = Math.min(tb[i], ta[j]);
				}
			}
		}
	}
	void dfs_(int h_, int i) {
		for (int l = ao_[i]; l != 0; l = next[l]) {
			int h = hh[l];
			if (h != h_) {
				int ih = find(ii[h]), jh = find(jj[h]);
				int j = i ^ ih ^ jh;
				if (i == ih) {
					int tmp = ii[h]; ii[h] = jj[h]; jj[h] = tmp;
				}
				dfs_(h, j);
			}
		}
	}
	void main() {
		int n = sc.nextInt();
		int m = sc.nextInt();
		init(n, m);
		for (int h = 0; h < m; h++) {
			int i = sc.nextInt() - 1;
			int j = sc.nextInt() - 1;
			ii[h] = i; jj[h] = j;
			ao[i] = link(ao[i], h);
			ao[j] = link(ao[j], h);
		}
		dfs(-1, 0);
		for (int b = 0; b < cnt; b++) {
			int h = hh_[b], i = find(ii[h]), j = find(jj[h]);
			ao_[i] = link(ao_[i], h);
			ao_[j] = link(ao_[j], h);
		}
		int ans = 0, i_ = -1;
		for (int i = 0; i < n; i++)
			if (ans < -dsu[i]) {
				ans = -dsu[i];
				i_ = i;
			}
		dfs_(-1, i_);
		println(ans);
		for (int h = 0; h < m; h++)
			println((ii[h] + 1) + " " + (jj[h] + 1));
	}
}