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

public class TouristReform {
    static ArrayList<Edge>[] graph;
    static boolean[] vis;
    static int[] inVal;
    static int[] ll;
    static int cnt = 0;
    static int[] cols;
    static int curCol = 0;
    public static void main(String[] args) {
        FastScanner scanner = new FastScanner();
        PrintWriter out = new PrintWriter(System.out, false);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        graph = new ArrayList[N];
        vis = new boolean[N];
        inVal = new int[N];
        ll = new int[N];
        cols = new int[N];
        Edge[] edges = new Edge[M];
        Arrays.fill(ll, -1);
        Arrays.fill(inVal, -1);
        for(int i = 0; i < N; i++) graph[i] = new ArrayList<>();
        for(int i = 0; i < M; i++) {
            int u = scanner.nextInt()-1;
            int v = scanner.nextInt()-1;
            edges[i] = new Edge(u, v);
            graph[u].add(edges[i]);
            graph[v].add(edges[i]);
        }
        dfs(0, -1);
        color(0, -1, 0);
        int[] cnts = new int[N];
        int max = -1;
        int maxCol = -1;
        for(int i = 0; i  < N; i++) {
            cnts[cols[i]]++;
            if (cnts[cols[i]] > max) {
                max = cnts[cols[i]];
                maxCol = cols[i];
            }
        }
        vis = new boolean[N];
        for(int i= 0; i < N; i++) {
            if (cols[i] == maxCol) {
                orientEdges(i, -1);
                break;
            }
        }
        out.println(max);
        for(Edge edge: edges) {
            out.println((edge.u+1) + " " + (edge.v+1));
        }
        out.flush();
    }
    
    static void orientEdges(int v, int p) {
        vis[v] = true;
        for(Edge edge: graph[v]) {
            int to = edge.getOther(v);
            if (to == p || edge.oriented) continue;
            edge.oriented = true;
            if (edge.isBridge) edge.orient(to, v);
            else edge.orient(v, to);
            if (!vis[to]) orientEdges(to, v);
        }
    }
    
    
    static void color(int v, int p, int c) {
        cols[v] = c;
        for(Edge edge: graph[v]) {
            int u = edge.getOther(v);
            if (u == p || !edge.used) continue;
            if (edge.isBridge) color(u, v, ++curCol);
            else color(u, v, c);
        }
    }
    
    static void dfs(int v, int p) {
        vis[v] = true;
        inVal[v] = ll[v] = cnt++;
        for(Edge to: graph[v]) {
            int u = to.getOther(v);
            if (u == p) continue;
            if (vis[u]) ll[v] = Math.min(ll[v], inVal[u]);
            else {
                to.used = true;
                dfs(u, v);
                ll[v] = Math.min(ll[v], ll[u]);
            }
            if (ll[u] > inVal[v]) to.isBridge = true;
        }
    }
    
    public static class Edge {
        int u, v;
        boolean used, isBridge, oriented;
        public Edge(int uu, int vv) {
            u = uu; v = vv;
        }
        int getOther(int cur) {
            if (cur == u) return v;
            return u;
        }
        void orient(int uu, int vv) {
            if (u != uu) {
                u = uu; v = vv;
            }
        }
    }
    
    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;
        
        public FastScanner(Reader in) {
            br = new BufferedReader(in);
        }
        
        public FastScanner() {
            this(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
        
        String readNextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
        
        int[] readIntArray(int n) {
            int[] a = new int[n];
            for (int idx = 0; idx < n; idx++) {
                a[idx] = nextInt();
            }
            return a;
        }
    }
}
