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 Main
{
	static final boolean _DEBUG = true;

	static class MyScanner {
		BufferedReader br;
		StringTokenizer st;

		public MyScanner(BufferedReader _br) {
			br = _br;
		}

		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (Exception e) {
					e.printStackTrace();
					return "";
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

	}

	static MyScanner   scan;
	static PrintWriter out;

	static int debugCount = 0;
	static void debug(String msg) {
		if (_DEBUG && debugCount < 200) {
			out.println(msg);
			out.flush();
			debugCount++;
		}
	}
	
    public static void main (String args[]) throws IOException {
//    	scan = new MyScanner(new BufferedReader(new FileReader("test.in")));
    	scan = new MyScanner(new BufferedReader(new InputStreamReader(System.in)));
    	out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        Main inst = new Main();
        inst.execute();
        out.close();
    }
    
    private class Edge {
    	int id;
    	int node1;
    	int node2;
    	boolean bridge;
    	
    	public Edge(int id, int node1, int node2) {
    		this.id = id;
    		this.node1 = node1;
    		this.node2 = node2;
    		bridge = false;
    	}
    	
    	public int getOther(int cur) {
    		if (cur == node2) {
    			return node1;
    		} else if (cur == node1) {
    			return node2;
    		} else {
    			return -1;
    		}
    	}
    	
    	public int getOtherComp(int comp) {
    		if (comp == comps[node2]) {
    			return comps[node1];
    		} else if (comp == comps[node1]) {
    			return comps[node2];
    		} else {
    			return -1;
    		}
    	}
    	
    	public void swap() {
    		int temp = node1;
    		node1 = node2;
    		node2 = temp;
    	}
    	
    	public String toString() {
    		return (node1+1)+" "+(node2+1);
    	}
    }
    
    int N, M, timer, compIndex;
    ArrayList<Edge>[] connected;
    ArrayList<Edge> bridges;
    ArrayList<ArrayList<Edge>> compBridges;
    Edge[] edges;
    boolean[] checked;
    int[] comps, tin, low;
    ArrayList<Integer> sizes;
    ArrayList<Boolean> compChecked;
    
    void dfs1(int node, int parent) {
    	if (checked[node]) {
    		return;
    	}
    	checked[node] = true;
    	tin[node] = low[node] = timer++;
        for (Edge edge : connected[node]) {
        	int child = edge.getOther(node);
            if (child != parent) {
            	if (checked[child]) {
                    low[node] = Math.min(low[node], tin[child]);
                } else {
                    dfs1(child, node);
                    low[node] = Math.min(low[node], low[child]);
                    if (low[child] > tin[node]) {
                    	edge.bridge = true;
                    	bridges.add(edge);
//                    	out.println("bridge");
                    }
                }
        	}	
        }
    }
    
    void dfs2(int node) {
    	if (comps[node] != -1) {
    		return;
    	}
    	comps[node] = compIndex;
    	sizes.set(compIndex, sizes.get(compIndex)+1);
    	for (Edge edge : connected[node]) {
    		if (edge.bridge) {
    			compBridges.get(compIndex).add(edge);
    		} else {
    			int child = edge.getOther(node);
    			if (comps[child] == -1) {
    				dfs2(child);
    			}
    		}
    	}
    }
    
    void dfs3(int comp) {
    	if (compChecked.get(comp)) {
    		return;
    	}
    	compChecked.set(comp, true);
    	for (Edge bridge : compBridges.get(comp)) {
    		int other = bridge.getOtherComp(comp);
    		if (!compChecked.get(other)) {
    			if (comps[bridge.node1] == comp) {
    				bridge.swap();
    			}
    			dfs3(other);
    		}
    	}
    }
    
    void dfs4(int node) {
    	if (!checked[node]) {
    		return;
    	}
    	checked[node] = false;
    	for (Edge edge : connected[node]) {
    		if (!edge.bridge) {
    			int other = edge.getOther(node);
    			if (checked[other]) {
    				dfs4(other);
    				if (edge.node1 == node) {
    					edge.swap();
    				}
    			} else if (edge.node1 == other) {
    				edge.swap();
    			}
    		}
    	}
    }
    
    private void execute() throws IOException {
    	N = scan.nextInt();
    	M = scan.nextInt();
    	compIndex = timer = 0;
    	connected = new ArrayList[N];
    	compBridges = new ArrayList<ArrayList<Edge>>();
    	compChecked = new ArrayList<Boolean>();
    	bridges = new ArrayList<Edge>();
    	edges = new Edge[M];
    	checked = new boolean[N];
    	comps = new int[N];
    	tin = new int[N];
    	low = new int[N];
    	sizes = new ArrayList<Integer>();
    	for (int i = 0; i < N; i++) {
    		connected[i] = new ArrayList<Edge>();
    		comps[i] = tin[i] = low[i] = -1;
    	}
    	for (int i = 0; i < M; i++) {
    		edges[i] = new Edge(i, scan.nextInt()-1, scan.nextInt()-1);
    		connected[edges[i].node1].add(edges[i]);
    		connected[edges[i].node2].add(edges[i]);
    	}
    	for (int i = 0; i < N; i++) {
    		if (!checked[i]) {
//    			System.out.println("dfs1 "+i);
    			dfs1(i, -1);
    		}
    	}
    	int max = 0;
//    	System.out.println(bridges.size());
    	for (int i = 0; i < N; i++) {
    		if (comps[i] == -1) {
    			sizes.add(0);
    			compBridges.add(new ArrayList<Edge>());
    			compChecked.add(false);
    			dfs2(i);
    			if (sizes.get(compIndex) > sizes.get(max)) {
    				max = compIndex;
    			}
    			dfs4(i);
    			compIndex++;
    		}
    	}
    	dfs3(max);
    	out.println(sizes.get(max));
    	for (Edge edge : edges) {
    		out.println(edge.toString());
    	}
    }
}