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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.StringTokenizer;
import javafx.util.Pair;

public class Solve6 {

    public static void main(String[] args) throws IOException {
        new Solve6().solve();
    }
    ArrayList<Pair<Integer, Integer>>[] adj;
    Pair<Integer, Integer>[] oredges;
    int[] low, num, size, color;
    int timer = 0;
    boolean[] bridges, visited, visedge;
    PrintWriter pw;

    public void solve() throws IOException {
        FastReader sc = new FastReader();
        pw = new PrintWriter(System.out);
        int n = sc.nextInt(), m = sc.nextInt();
        adj = new ArrayList[n + 1];
        for (int i = 1; i <= n; i++) {
            adj[i] = new ArrayList();
        }
        for (int i = 1; i <= m; i++) {
            int x = sc.nextInt(), y = sc.nextInt();
            adj[x].add(new Pair(y, i));
            adj[y].add(new Pair(x, i));
        }
        low = new int[n + 1];
        num = new int[n + 1];
        bridges = new boolean[m + 1];
        dfsOrder(1, 1);
        timer = 0;
        size = new int[n + 1];
        color = new int[n + 1];
        int maxColor = 0, maxInd = 0;
        for (int i = 1; i <= n; i++) {
            if (color[i] == 0) {
                timer++;
                dfs(i, i);
                if (size[timer] > size[maxColor]) {
                    maxColor = timer;
                    maxInd = i;
                }
            }
        }
        pw.println(size[maxColor]);
        visited = new boolean[n + 1];
        visedge = new boolean[m + 1];
        oredges = new Pair[m + 1];
        dfs2(maxInd, 0);
        for (int i = 1; i <= m; i++) {
            pw.println(oredges[i].getKey() + " " + oredges[i].getValue());
        }
        pw.flush();
        pw.close();
    }

    public void dfsOrder(int u, int p) {
        num[u] = low[u] = ++timer;
        for (Pair<Integer, Integer> temp : adj[u]) {
            int v = temp.getKey();
            if (v == p) {
                continue;
            }
            if (num[v] == 0) {
                dfsOrder(v, u);
                if (num[u] < low[v]) {
                    bridges[temp.getValue()] = true;
                }
                low[u] = Math.min(low[u], low[v]);
            } else {
                low[u] = Math.min(low[u], num[v]);
            }
        }
    }

    public void dfs(int u, int p) {
        color[u] = timer;
        size[timer]++;
        for (Pair<Integer, Integer> temp : adj[u]) {
            int v = temp.getKey();
            if (v == p) {
                continue;
            }
            if (bridges[temp.getValue()]) {
                continue;
            }
            if (color[v] == 0) {
                dfs(v, u);
            }

        }
    }

    public void dfs2(int u, int p) {
        visited[u] = true;
        for (Pair<Integer, Integer> temp : adj[u]) {
            int v = temp.getKey();
            if (v == p) {
                continue;
            }
            if (!visedge[temp.getValue()]) {
                visedge[temp.getValue()] = true;
                oredges[temp.getValue()] = new Pair(v, u);
            }
            if (!visited[v]) {
                dfs2(v, u);
            }
        }
    }

    static class FastReader {

        StringTokenizer st;
        BufferedReader br;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() throws IOException {
            if (st == null || !st.hasMoreTokens()) {
                String s = br.readLine();
                if (s.isEmpty()) {
                    return null;
                }
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }
    }
}