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.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;

public class FTask {

    static int[][][] g;
    static int[][] e;
    static int blen = 0;
    static int[] low;
    static int[] fup;
    static int cnt;
    static int cmax = 0;
    static int ccur = 0;
    static int vmax = -1;

    public static void main(String[] args) {

        MyInputReader in = new MyInputReader(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        e = new int[m][2];
        int[] cnt = new int[n];
        for (int i = 0; i < m; i++) {
            int f = in.nextInt() - 1;
            int t = in.nextInt() - 1;
            e[i][0] = f;
            e[i][1] = t;
            cnt[f] += 1;
            cnt[t] += 1;
        }
        low = new int[n];
        fup = new int[n];
        g = new int[n][][];
        for (int i = 0; i < n; i++) {
            g[i] = new int[cnt[i]][5];
            cnt[i] = 0;
            low[i] = -1;
        }
        for (int i = 0; i < m; i++) {
            int f = e[i][0];
            int t = e[i][1];
            g[f][cnt[f]][0] = t;
            g[t][cnt[t]][0] = f;
            g[f][cnt[f]][4] = i;
            g[t][cnt[t]][4] = i;
            g[f][cnt[f]][1] = cnt[t];
            g[t][cnt[t]][1] = cnt[f];
            cnt[f]++;
            cnt[t]++;
            e[i][0] = 0;
            e[i][1] = 0;
        }
        bfs(-1, 0);
        for (int i = 0; i < n; i++) {
            low[i] = -1;
        }
        for (int i = 0; i < n; i++) {
            if (low[i] >= 0) {
                continue;
            }
            ccur = 0;
            comp(-1, i);
            if (ccur > cmax) {
                cmax = ccur;
                vmax = i;
            }
        }
        for (int i = 0; i < n; i++) {
            low[i] = -1;
        }
        System.out.println(cmax);
        mark(-1, vmax);
        for (int i = 0; i < m; i++) {
            System.out.println(e[i][0] + " " + e[i][1]);
        }
    }

    static void mark(int p, int v) {
        if (low[v] > 0) {
            return;
        }
        low[v] = 1;
        for (int i = 0; i < g[v].length; i++) {
            int to = g[v][i][0];
            int bridge = g[v][i][2];
            if (p == to) {
                continue;
            }
            if (low[to] > 0) {
                print(v, i, false);
                continue;
            }
            if (bridge > 0) {
                print(v, i, true);
                mark(v, to);
                continue;
            }
            print(v, i, false);
            mark(v, to);
        }
    }

    static void print(int v, int i, boolean rev) {
        int to = g[v][i][0];
        int toi = g[v][i][1];
        if (g[v][i][3] == -1 || g[to][toi][3] == -1) {
            return;
        }
        g[v][i][3] = -1;
        g[to][toi][3] = -1;
        int ei = g[v][i][4];
        if (rev) {
            //System.out.println((to + 1) + " " + (v + 1));
            e[ei][0] = to + 1;
            e[ei][1] = v + 1;
        } else {
            //System.out.println((v + 1) + " " + (to + 1));
            e[ei][0] = v + 1;
            e[ei][1] = to + 1;
        }
    }

    static void comp(int p, int v) {
        ccur += 1;
        low[v] = 1;
        for (int i = 0; i < g[v].length; i++) {
            int to = g[v][i][0];
            int bridge = g[v][i][2];
            if (low[to] > 0) {
                continue;
            }
            if (bridge > 0) {
                continue;
            }
            if (to == p) {
                continue;
            }
            comp(v, to);
        }
    }

    static void bfs(int p, int v) {
        low[v] = cnt++;
        fup[v] = low[v];
        for (int i = 0; i < g[v].length; i++) {
            int to = g[v][i][0];
            if (to == p) {
                continue;
            }
            if (low[to] > -1) {
                fup[v] = Math.min(fup[v], low[to]);
            } else {
                bfs(v, to);
                fup[v] = Math.min(fup[v], fup[to]);
                if (fup[to] > low[v]) {
                    g[v][i][2] = 1;
                    g[g[v][i][0]][g[v][i][1]][2] = 1;
                }
            }
        }
    }

    static class MyInputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public MyInputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768 * 10);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

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

    }

}