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 F {
    
    public static void bridge(int cur) {
        index[cur] = counter;
        low[cur] = counter;
        counter++;
        visited[cur] = true;
        for (int v: adj.get(cur)) {
            if (!visited[v]) {
                par[v] = cur;
                bridge(v);
                if (low[v] > index[cur]) { //bridge
                    //bridges.add(new Edge(cur, v));
                    bridges.add(1000000L * cur + v);
                }
                low[cur] = Math.min(low[cur], low[v]);
            } else if (v != par[cur]) { //not the parent
                low[cur] = Math.min(low[cur], index[v]);
            }
        }
    }
    
    public static void label(int cur) {
        visited[cur] = true;
        counter++;
        for (int v: adj.get(cur)) {
            //if (!visited[v] && !bridges.contains(new Edge(cur, v)) && !bridges.contains(new Edge(v, cur))) { //not a bridge
            if (!visited[v] && !bridges.contains(1000000L * cur + v) && !bridges.contains(1000000L * v + cur)) { //not a bridge
                label(v);
            }
        }
    }
    
    public static void orient(int start) {
        LinkedList<Integer> stack = new LinkedList<Integer>();
        stack.add(start);
        while (stack.size() != 0) {
            int cur = stack.pollLast();
            //Edge e1 = new Edge(v, cur);
            //Edge e2 = new Edge(cur, v);
            int prev = par[cur];
            if (prev != -1) {
                long e1 = 1000000L * cur + prev;
                long e2 = 1000000L * prev + cur;
                if (!wanted.contains(e1) && !wanted.contains(e2)) {
                    if (bridges.contains(e1) || bridges.contains(e2)) {
                        wanted.add(e1);
                        //System.out.println(e1);
                    } else {
                        wanted.add(e2);
                        //System.out.println(e2);
                    }
                }
            }
            if (!visited[cur]) {
                for (int v: adj.get(cur)) {
                    par[v] = cur;
                    stack.add(v);
                }
            }
            visited[cur] = true;
        }
    }
    
    public static ArrayList<LinkedList<Integer>> adj;
    public static int[] par;
    public static int[] low;
    public static int[] index;
    public static int counter;
    public static boolean[] visited;
    public static HashSet<Long> bridges = new HashSet<Long>();
    public static HashSet<Long> wanted = new HashSet<Long>();
    
    public static void main(String[]args) throws IOException {
        BufferedReader x = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(x.readLine());
        int n = Integer.parseInt(st.nextToken());
        int m = Integer.parseInt(st.nextToken());
        adj = new ArrayList<LinkedList<Integer>>();
        for (int i = 0; i < n; i++) {
            adj.add(new LinkedList<Integer>());
        }
        int[] us = new int[m];
        int[] vs = new int[m];
        for (int i = 0; i < m; i++) {
            st = new StringTokenizer(x.readLine());
            int u = Integer.parseInt(st.nextToken()) - 1;
            int v = Integer.parseInt(st.nextToken()) - 1;
            us[i] = u;
            vs[i] = v;
            adj.get(u).add(v);
            adj.get(v).add(u);
        }
        par = new int[n];
        for (int i = 0; i < n; i++) {
            par[i] = -1;
        }
        low = new int[n];
        index = new int[n];
        visited = new boolean[n];
        counter = 0;
        bridge(0);
        
        //find largest biconnected component
        int largest = 0;
        int startVertex = -1;
        visited = new boolean[n];
        for (int i = 0; i < n; i++) {
            if (!visited[i]) {
                counter = 0;
                label(i);
                if (counter > largest) {
                    largest = counter;
                    startVertex = i;
                }
            }
        }
        System.out.println(largest);
        
        visited = new boolean[n];
        par = new int[n];
        for (int i = 0; i < n; i++) {
            par[i] = -1;
        }
        orient(startVertex);
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < m; i++) {
            //Edge curEdge = new Edge(us[i], vs[i]);
            long curEdge = 1000000L * us[i] + vs[i];
            us[i]++; //1-indexing
            vs[i]++;
            if (wanted.contains(curEdge)) {
                sb.append(us[i] + " " + vs[i] + "\n");
            } else {
                sb.append(vs[i] + " " + us[i] + "\n");
            }
        }
        System.out.print(sb.toString());
    }
}