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;
int e1[400005];
int e2[400005];
int b[400005];
int d[400005];
int c[400005];
bool isb[400005];
bool o[400005];
bool ao[400005];
int nn[400005];
int q[400005];
int f[400005];
vector<int> g[400005];
vector<pair<int, int> > g2[400005];
int tt;
int n, m;
int nc;
void dfs(int u, int pe) {
  b[u] = d[u] = tt++;
  for (int _ = 0, to = g[u].size(); _ < to; ++_) {
    int ne = g[u][_];
    if (ne == pe) continue;
    if (!ao[ne]) {
      o[ne] = e1[ne] == u;
      ao[ne] = true;
    }
    int v = e1[ne] ^ e2[ne] ^ u;
    if (d[v] < 0) {
      dfs(v, ne);
      if (b[v] > d[u]) {
        isb[ne] = true;
      }
      b[u] = min(b[u], b[v]);
    } else if (d[v] < d[u])
      b[u] = min(b[u], d[v]);
  }
}
void dfs2(int x, int cc) {
  if (c[x] >= 0) return;
  c[x] = cc;
  nn[cc]++;
  for (int i = 0, to = g[x].size(); i < to; ++i) {
    int e = g[x][i];
    if (isb[e]) continue;
    dfs2(e1[e] ^ e2[e] ^ x, cc);
  }
}
bool dfs3(int x, int p, int k) {
  q[x] = nn[x];
  f[x] = max(k - q[x], 0);
  for (int i = 0, to = g2[x].size(); i < to; ++i) {
    int y = g2[x][i].first;
    int e = g2[x][i].second;
    if (y == p) continue;
    if (dfs3(y, x, k)) {
      q[x] += q[y];
      o[e] = c[e1[e]] == x;
      f[x] = max(k - q[x], 0);
    } else {
      o[e] = c[e2[e]] == x;
    }
  }
  for (int i = 0, to = g2[x].size(); i < to; ++i) {
    int y = g2[x][i].first;
    if (y == p) continue;
    if (f[y]) f[x] = max(f[x], f[y] - q[x]);
  }
  return f[x] == 0;
}
bool can(int k) { return dfs3(0, -1, k); }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0, to = m; i < to; ++i) {
    scanf("%d%d", e1 + i, e2 + i);
    e1[i]--;
    e2[i]--;
    g[e1[i]].push_back(i);
    g[e2[i]].push_back(i);
  }
  memset(d, -1, sizeof(d));
  dfs(0, -1);
  memset(c, -1, sizeof(c));
  for (int i = 0, to = n; i < to; ++i) {
    if (c[i] < 0) {
      dfs2(i, nc);
      nc++;
    }
  }
  for (int i = 0, to = m; i < to; ++i) {
    if (isb[i]) {
      g2[c[e1[i]]].push_back(make_pair(c[e2[i]], i));
      g2[c[e2[i]]].push_back(make_pair(c[e1[i]], i));
    }
  }
  int s = 0, e = n + 1;
  while (e - s > 1) {
    int m = (s + e) / 2;
    if (can(m))
      s = m;
    else
      e = m;
  }
  assert(can(s));
  printf("%d\n", s);
  for (int i = 0, to = m; i < to; ++i) {
    if (o[i])
      printf("%d %d\n", e1[i] + 1, e2[i] + 1);
    else
      printf("%d %d\n", e2[i] + 1, e1[i] + 1);
  }
  return 0;
}