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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
A cvt(B x) {
  stringstream ss;
  ss << x;
  A y;
  ss >> y;
  return y;
}
int n, m, q;
vector<pair<int, int> > adj[400000];
int edge[400000][2];
int bridge[400000];
int comp[400000];
int comps;
vector<pair<int, int> > adjc[400000];
int t = 0;
int lo[400000], ind[400000];
void tarjan(int x, int par = -1) {
  ind[x] = t;
  lo[x] = t;
  t++;
  for (pair<int, int> yi : adj[x]) {
    int y = yi.first, i = yi.second;
    if (i == par) continue;
    if (ind[y] == -1) {
      tarjan(y, i);
      lo[x] = min(lo[x], lo[y]);
      if (lo[y] > ind[x]) bridge[i] = 1;
    } else {
      lo[x] = min(lo[x], ind[y]);
    }
  }
}
int v[400000];
int components(int x, int c) {
  v[x] = 1;
  comp[x] = c;
  int sz = 1;
  for (pair<int, int> yi : adj[x]) {
    int y = yi.first, i = yi.second;
    if (!v[y] && !bridge[i]) sz += components(y, c);
  }
  return sz;
}
int done[400000];
void dfs(int x) {
  for (pair<int, int> yi : adj[x]) {
    int y = yi.first, i = yi.second;
    if (!done[i]) {
      done[i] = 1;
      edge[i][0] = y;
      edge[i][1] = x;
      dfs(y);
    }
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < (int)(m); i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    x--;
    y--;
    edge[i][0] = x;
    edge[i][1] = y;
    adj[x].push_back({y, i});
    adj[y].push_back({x, i});
  }
  memset(ind, -1, sizeof(ind));
  for (int i = 0; i < (int)(n); i++)
    if (ind[i] == -1) {
      tarjan(i);
    }
  int c = 0;
  memset(comp, -1, sizeof(comp));
  memset(v, 0, sizeof(v));
  int msz = 0, start = -1;
  for (int i = 0; i < (int)(n); i++)
    if (!v[i]) {
      int sz = components(i, c);
      if (sz > msz) {
        msz = sz;
        start = i;
      }
      c++;
    }
  comps = c;
  printf("%d\n", msz);
  dfs(start);
  for (int i = 0; i < (int)(m); i++)
    printf("%d %d\n", edge[i][0] + 1, edge[i][1] + 1);
  return 0;
}