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.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.ArrayList;

public class TouristReformF
{
    static int s=0;
    static ArrayList<Edge> al[];
    static int timer=1,low[],in[];
    static boolean vis[];
    static int ans[][];
    static class Reader
    {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }
    static class Edge
    {
        int dest,index,src;
        boolean isBridge=false;
        boolean used=false;
        Edge(int src,int dest,int index)
        {
            this.src=src;
            this.dest=dest;
            this.index=index;
        }
    }
    public static void main(String args[])throws IOException
    {
        Reader sc=new Reader();
        int n=sc.nextInt();
        al=new ArrayList[n+1];
        vis=new boolean[n+1];
        low=new int[n+1];
        in=new int [n+1];
        for(int i=0;i<=n;i++)
        {
            al[i]=new ArrayList<>();
        }
        int m=sc.nextInt();
        ans=new int[m][2];
        int cnt=0;
        while(cnt<m)
        {
            int src=sc.nextInt();
            int dest=sc.nextInt();
            AddEdge(src,dest,cnt);
            cnt++;
        }
        dfs(1,-1);
        vis=new boolean[n+1];
        int maxsze=0,root=0;
        for(int i=1;i<=n;i++)
        {
            if(!vis[i])
            {
                dfs2(i);
                if(maxsze<s)
                {
                    maxsze=s;
                    root=i;
                }
                s=0;
            }
        }
        System.out.println(maxsze);
        vis=new boolean[n+1];
        dfs3(root);
        for(int i=0;i<m;i++)
        {
            System.out.println(ans[i][0]+" "+ans[i][1]);
        }
    }
    public static void dfs(int src,int parent)
    {
        in[src]=timer;
        low[src]=timer++;
        vis[src]=true;
        for(Edge a:al[src])
        {
            int vert=a.src==src?a.dest:a.src;
            if(vert==parent)
            {
                continue;
            }
            if(vis[vert])
            {
                low[src]=Math.min(low[src],in[vert]);
            }
            else
            {
                dfs(vert,src);
                if(in[src]<low[vert])
                {
                    //Its a bridge
                    a.isBridge=true;
                }
                low[src]=Math.min(low[src],low[vert]);
            }
        }
    }
    public static void dfs2(int src)
    {
        vis[src]=true;
        s++;
        for(Edge e:al[src])
        {
            int vert=e.src==src?e.dest:e.src;
            if(e.isBridge)
            {
                continue;
            }
            else
            {
                if(!vis[vert])
                dfs2(vert);
            }
        }
    }
    public static void dfs3(int src)
    {
        vis[src]=true;
        for(Edge e:al[src])
        {
            int vert=e.src==src?e.dest:e.src;
            if(!e.used)
            {
                e.used=true;
                if(e.isBridge)
                {
                    ans[e.index][0]=vert;
                    ans[e.index][1]=src;
                }
                else
                {
                    ans[e.index][0]=src;
                    ans[e.index][1]=vert;
                }
            }
            if(!vis[vert])
                dfs3(vert);
        }
    }
    public static void AddEdge(int src,int dest,int cnt)
    {
        Edge e=new Edge(src,dest,cnt);
        al[src].add(e);
        al[dest].add(e);
    }
}

/*

17
23
1 4 1 7 3 4 3 7 3 8 8 9 8 11 9 10 11 10 11 12 9 12 13 11 13 12 9 5 2 6 2 5 6 5 8 14 14 15 14 17 14 16 16 15 16 17
 */