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.*;
import java.math.*;
 
public class Main {
    static PrintWriter out;
    static Reader in;
    public static void main(String[] args) throws IOException {
        //out = new PrintWriter(new File("out.txt"));
        //PrintWriter out = new PrintWriter(System.out);
        //in = new Reader(new FileInputStream("in.txt"));
        //Reader in = new Reader();
        input_output();
        Main solver = new Main();
        solver.solve();
        out.flush();
        out.close();
 
    }
 
    static int INF = (int)2e9+5;
    static int maxn = (int)2e6+5;
    static int mod=(int)1e9+7 ;
    static int n, m, t, q, k;
    // read the editorial of the last problem (K).
    
    static ArrayList<Node> adj[];
    static int[] start, cnt;

    void solve() throws IOException{
        n = in.nextInt();
        m = in.nextInt();

        adj = new ArrayList[n+1];
        for (int i = 1; i <= n; i++) adj[i] = new ArrayList<Node>();

        start = new int[m];
        int[] u = new int[m],
              v = new int[m];
        for (int i = 0; i < m; i++) {
            u[i] = in.nextInt();
            v[i] = in.nextInt();
            adj[u[i]].add(new Node(v[i], i));
            adj[v[i]].add(new Node(u[i], i));
        }

        visited = new boolean[n+1];
        bridge = new boolean[n+1];
        desc = new int[n+1];
        low = new int[n+1];
        parent = new int[n+1];
        time = 1;
        DFS(1);

        visited = new boolean[n+1];
        cnt = new int[n+1];
        type = new int[n+1];
        deque = new ArrayDeque<Integer>();
        deque.add(1);
        bridge[1] = true;
        while (deque.size() != 0) {
            int i = deque.poll();
            if (!bridge[i] || visited[i]) continue;
            count(i, i);
        }
        bridge[1] = false;

        int max = 0, id = 0;
        for (int i = 1; i <= n; i++) {
            if (cnt[i] > max) {
                max = cnt[i];
                id = i;
            }
        }

        visited = new boolean[n+1];
        vis = new boolean[m+1];
        que = new ArrayDeque<Integer>();
        que.add(id);
        while (que.size() != 0) {
            id = que.poll();
            if (visited[id]) continue;
            visited[id] = true;
            DFS2(id);
        }

        out.println(max);
        for (int i = 0; i < m; i++) {
            if (u[i] == start[i]) out.println(u[i]+" "+v[i]);
            else out.println(v[i]+" "+u[i]);
        }
    }
 
    //<>

    static int[] type;
    static ArrayDeque<Integer> deque;
    static void count(int s, int tt) {
        cnt[tt]++;
        type[s] = tt;
        visited[s] = true;

        for (Node node: adj[s]) {
            int e = node.to;
            if (visited[e]) continue;
            if (bridge[e]) {
                deque.add(e);
                continue;
            }
            count(e, tt);
        }
    }

    static boolean[] vis;    
    static ArrayDeque<Integer> que;
    static void DFS2(int s) {

        for (Node node: adj[s]) {
            int e = node.to;
            if (type[s] == type[e]) {
                if (vis[node.id]) continue;
                vis[node.id] = true;
                start[node.id] = s;
                if (visited[e]) continue;
                visited[e] = true;
                DFS2(e);
            } else {
                if (vis[node.id] || visited[e]) continue;
                start[node.id] = e;
                que.add(e);
            }
        }
    }

    static boolean[] visited, bridge;
    static int[] desc, low, parent;
    static int time;

    static void DFS(int s){
        visited[s] = true;
        desc[s] = time;
        low[s]  = time;
        
        for(Node node:adj[s]){
            int e = node.to;
            if(!visited[e]){
                parent[e] = s;
                time++;
                DFS(e);

                low[s] = Math.min(low[s],low[e]);

                if(low[e] > desc[s]) bridge[e] = true;
            }else if(parent[s] != e) low[s] = Math.min(low[s],desc[e]);
        }
    }

    static class Node {
        int to, id;

        Node(int to, int id) {
            this.to = to;
            this.id = id;
        }
    }

    static class Reader {
 
        private InputStream mIs;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
    
        public Reader() {
            this(System.in);
        }
    
        public Reader(InputStream is) {
            mIs = is;
        }
    
        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
    
        }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = mIs.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }
    
        public String nextLine() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }
    
        public String next() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }
    
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
    
        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
    
        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }
    
        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
    
        public boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
 
    }
    static void input_output() throws IOException {
        File f = new File("in.txt");
        if(f.exists() && !f.isDirectory()) { 
            in = new Reader(new FileInputStream("in.txt"));
        } else in = new Reader();
        f = new File("out.txt");
        if(f.exists() && !f.isDirectory()) {
            out = new PrintWriter(new File("out.txt"));
        } else out = new PrintWriter(System.out);
    }
}