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

public class Main extends Reader {

    static final int N = 400010; 
    static int dfn[] = new int[N];
    static int low[] = new int[N];
    static int sta[] = new int[N];
    static int col[] = new int[N], s[] = new int[N];    
    static int index, scc, top;

    //store answer
    static int a[] = new int[N], b[] = new int[N];
    static int aa[] = new int[N], bb[] = new int[N];
    static int p[] = new int[N];
    
    static class Link {
        Link(int to, Link next, int no) {
            this.to = to;
            this.no = no;
            this.next = next;
        }
        int to, no;
        Link next;
    }
    static Link h[] = new Link[N];
    static Link h2[] = new Link[N];
    
    static void tarjan(int u, int father)  
    {  
        dfn[u] = low[u] = ++ index;
        sta[top++] = u;
        for (Link i = h[u]; i != null; i = i.next)  
        {  
            int v = i.to;
            if (dfn[v] == 0) {  
                tarjan(v, u);  
                low[u] = Math.min(low[u], low[v]);  
            }  else if (v != father)  {
                low[u] = Math.min(low[u], dfn[v]);  
            }  
        }
        if(dfn[u]==low[u]) {
            int x;
            do {
                x = sta[--top];
                col[x] = scc;
                s[scc]++;
            } while(x != u);
            scc++;
        }
    }
    
    static void dfs(int x) {
        if (p[x] == 1) return;
        p[x] = 1;
        for (Link i = h[x]; i!=null; i=i.next) {
            if (col[i.to] != col[x]) {
                h2[col[x]] = new Link(col[i.to], h2[col[x]], i.no);
                continue;
            }
            if (a[i.no] != 0) continue;
            a[i.no] = x+1; b[i.no] = i.to+1;
            dfs(i.to);
        }
    }
    
    static void dfs2(int x, int fa) {
        for (Link i = h2[x]; i!=null; i=i.next) {
            if (i.to == fa) continue;
            if (col[bb[i.no]-1] != x) {
                a[i.no] = bb[i.no];
                b[i.no] = aa[i.no];
            } else {
                b[i.no] = bb[i.no];
                a[i.no] = aa[i.no];
            }
            dfs2(i.to, x);
        }
    }
    
	public static void main(String[] args) throws IOException {
	    int n = ni(), m = ni();
	    for (int i=0; i<m; i++) {
	        int u = (aa[i]=ni())-1, v = (bb[i]=ni())-1;
	        h[u] = new Link(v, h[u], i);
	        h[v] = new Link(u, h[v], i);
	    }
	    tarjan(0, -1);
	    int k = 0;
	    for (int i=0; i<n; i++) {
	        dfs(i);
	        if (s[k] < s[col[i]]) k = col[i];
	    }
	    dfs2(k, -1);
	    System.out.println(s[k]);
	    for (int i=0; i<m; i++) System.out.println(a[i]+" "+b[i]);
	}
}



class Reader {
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    static StringTokenizer tokenizer = new StringTokenizer("");

    /** call this method to change InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(new InputStreamReader(input) );
    }

    /** get next word */
    static String ns() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int ni() throws IOException {
        return Integer.parseInt( ns() );
    }
	
    static double nd() throws IOException {
        return Double.parseDouble( ns() );
    }
    static long nl() throws IOException {
        return Long.valueOf( ns() );
    }
}