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:

// Problem: F. Tourist Reform
// Contest: Codeforces - Codeforces Round #377 (Div. 2)
// URL: https://codeforces.com/contest/732/problem/F
// Memory Limit: 256 MB
// Time Limit: 4000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

import java.io.*;
import java.util.*;

public class Main {
    private static PrintWriter pw = new PrintWriter(System.out);
    private static InputReader sc = new InputReader();
    private static final int intmax = Integer.MAX_VALUE, intmin = Integer.MIN_VALUE;

    static class Pair{
        int first, second;
        Pair(int first, int second){
            this.first = first;
            this.second = second;
        }
    }

    static class InputReader{
        private static BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
        private static StringTokenizer tk;

        private void next()throws IOException{
            if(tk == null || !tk.hasMoreTokens())   
                tk = new StringTokenizer(r.readLine());
        }

        private int nextInt()throws IOException{
            next();
            return Integer.parseInt(tk.nextToken());
        }

        private long nextLong()throws IOException{
            next();
            return Long.parseLong(tk.nextToken());
        }
    }

    public static void main(String args[])throws IOException{
        int t = 1;
        while(t-->0)    solve();
        pw.flush();
        pw.close();
    }

	private static ArrayList<HashMap<Integer, Integer>> graph;
	private static boolean isBridge[];
	private static int backEdgeCnt[], level[], edges[][], id[];

	private static void findBridges(int node, int edgeID){
		for(Integer neighbor: graph.get(node).keySet()){
			if(level[neighbor] == -1){
				level[neighbor] = level[node] + 1;
				
				findBridges(neighbor, graph.get(node).get(neighbor));
				
				backEdgeCnt[node] += backEdgeCnt[neighbor] - 1;
			}
			else if(level[neighbor] < level[node])
				backEdgeCnt[node]++;
			else if(level[neighbor] > level[node])
				backEdgeCnt[node]--;
		}
		if(backEdgeCnt[node] == 1){
				// System.out.println(+node+" "+backEdgeCnt[node]);
				isBridge[edgeID] = true;
				// pw.println("Bridge ID:"+edgeID);
		}
	}
	
	private static void assignID(int node, int q){
		for(Integer neighbor : graph.get(node).keySet()){
			if(id[neighbor] == -1 && !isBridge[graph.get(node).get(neighbor)]){
				id[neighbor] = q;
				assignID(neighbor, q);
			}
		}
	}
	
	private static void assignDirection(int node){
		for(Map.Entry<Integer, Integer> entry: graph.get(node).entrySet()){
			
			int to = entry.getKey(), edgeID = entry.getValue();
			
			if(edges[edgeID][0] == -1){
				if(isBridge[edgeID]){
					
					edges[edgeID][0] = to;
					edges[edgeID][1] = node;
					
				}
				else{
					
					edges[edgeID][0] = node;
					edges[edgeID][1] = to;
					
				}
			}
			
			if(level[to] == -1){
				level[to] = 1;
				assignDirection(to);
			}
		}
	}

    private static void solve()throws IOException{
		int n = sc.nextInt(), m = sc.nextInt();
		
		graph = new ArrayList<>();
		for(int i=0; i<n; i++)
			graph.add(new HashMap<>());
			
		edges = new int[m][2];
			
		for(int i=0; i<m; i++){
			int u = sc.nextInt() - 1, v = sc.nextInt() - 1;
			graph.get(u).put(v, i);
			graph.get(v).put(u, i);
			edges[i][0] = -1;
			edges[i][1] = -1;
		}
		
		backEdgeCnt = new int[n];
		level = new int[n];
		id = new int[n];
		isBridge = new boolean[m];
		
		Arrays.fill(id, -1);
		Arrays.fill(level, -1);
		
		level[0] = 0;
		findBridges(0, -1);
		
		for(int i=0; i<n; i++){
			if(id[i] == -1){
				id[i] = i;
				assignID(i, i);
			}
		}
		
		int size[] = new int[n], maxSizeID = 0;
		for(int i=0; i<n; i++){
			size[id[i]]++;
			
			if(size[id[i]] > size[maxSizeID])
				maxSizeID = id[i];
		}
		
		int beginningNode = -1;
		for(int i=0; i<n; i++){
			if(id[i] == maxSizeID){
				beginningNode = i;
				break;
			}
		}
		
		Arrays.fill(level, -1);
		level[beginningNode] = 1;
		assignDirection(beginningNode);
		
		pw.println(+size[maxSizeID]);
		for(int edge[]: edges)
			pw.println(+(edge[0]+1)+" "+(edge[1]+1));
    }
}