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:
import java.io.*;
import java.util.*;

public class TouristReform {
	
	static boolean[] vis;
	static int[] tin, low;
	static int timer = 0;
	static ArrayList<Edge>[] adj;
	static Edge[] edges;
	public static void main(String[] args) throws Exception{
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		
		StringTokenizer st = new StringTokenizer(f.readLine());
		
		int n = Integer.parseInt(st.nextToken());
		int m = Integer.parseInt(st.nextToken());
		
		edges = new Edge[m];
		adj = new ArrayList[n];
		for(int i = 0; i < n; i ++) {
			adj[i] = new ArrayList<Edge>();
		}
		for(int i = 0; i < m; i ++) {
			st = new StringTokenizer(f.readLine());
			int x = Integer.parseInt(st.nextToken()) - 1;
			int y = Integer.parseInt(st.nextToken()) - 1;
			Edge e = new Edge(i,x,y);
			adj[x].add(e);
			adj[y].add(e);
			edges[i] = e;
		}
		
		tin = new int[n];
		vis = new boolean[n];
		low = new int[n];
		Arrays.fill(tin, -1);
		Arrays.fill(low, -1);
		
		dfs(0,-1);
		
		int ans = -1;
		int root = -1;
		vis = new boolean[n];
		for(int i = 0; i < n; i ++) {
			if(!vis[i]) {
				Queue<Integer> q = new LinkedList<Integer>();
				ArrayList<Integer> component = new ArrayList<Integer>();
				vis[i] = true;
				q.add(i);
				component.add(i);
				while(!q.isEmpty()) {
					int x = q.remove();
					for(Edge e:adj[x]) {
						if(!e.isBridge) {
							int to = (e.x == x) ? e.y : e.x;
							if(!vis[to]) {
								vis[to] = true;
								q.add(to);
								component.add(to);
							}
						}
					}
				}
				if(ans < component.size()) {
					ans = component.size();
					root = component.get(0);
				}
			}
		}
		
		vis = new boolean[n];
		dfs2(root,-1);
		
		System.out.println(ans);
		for(int i = 0; i < m; i ++) {
			System.out.println((edges[i].a+1) + " " + (edges[i].b+1));
		}
	}
	
	static void dfs(int v, int p) {
		vis[v] = true;
		tin[v] = timer;
		low[v] = timer;
		timer ++;
		for(Edge e: adj[v]) {
			int to = (e.x == v) ? e.y : e.x;
			if(to == p) {
				continue;
			}
			if(vis[to]) {
				low[v] = Math.min(low[v], tin[to]);
			}
			else {
				dfs(to,v);
				low[v] = Math.min(low[v], low[to]);
				if(low[to] > tin[v]) {
					e.isBridge = true;
				}
			}
		}
	}
	
	static void dfs2(int v, int p) {
		vis[v] = true;
		for(Edge e: adj[v]) {
			int to = (e.x == v) ? e.y : e.x;
			if(!e.used) {
				e.used = true;
				if(e.isBridge) {
					e.a = to;
					e.b = v;
				}
				else {
					e.a = v;
					e.b = to;
				}
			}
			
			if(!vis[to]) {
				dfs2(to,v);
			}
		}
	}
	
	static class Edge{
		int i, x, y, a, b;
		boolean isBridge = false;
		boolean used = false;
		public Edge(int ii,int xx,int yy) {
			i = ii;
			x = xx;
			y = yy;
		}
	}

}