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;
class SCC_BI {
 public:
  static const int MV = 410000;
  int NV, time;
  vector<vector<int> > E;
  vector<int> ord, llink, inin;
  stack<int> roots, S;
  vector<int> M;
  vector<int> ART;
  vector<vector<int> > SC;
  vector<pair<int, int> > BR;
  void init(int NV = MV) {
    this->NV = NV;
    E.clear();
    E.resize(NV);
  }
  void add_edge(int x, int y) {
    assert(NV);
    E[x].push_back(y);
    E[y].push_back(x);
  }
  void dfs(int cur, int pre) {
    int art = 0, conn = 0, i, se = 0;
    ord[cur] = llink[cur] = ++time;
    S.push(cur);
    inin[cur] = 1;
    roots.push(cur);
    for (i = 0; i < (E[cur].size()); i++) {
      int tar = E[cur][i];
      if (ord[tar] == 0) {
        conn++;
        dfs(tar, cur);
        llink[cur] = min(llink[cur], llink[tar]);
        art += (pre != -1 && ord[cur] <= llink[tar]);
        if (ord[cur] < llink[tar])
          BR.push_back(make_pair(min(cur, tar), max(cur, tar)));
      } else if (tar != pre || se) {
        llink[cur] = min(llink[cur], ord[tar]);
        while (inin[tar] && ord[roots.top()] > ord[tar]) roots.pop();
      } else
        se++;
    }
    if (cur == roots.top()) {
      SC.push_back(vector<int>());
      while (1) {
        i = S.top();
        S.pop();
        inin[i] = 0;
        SC.back().push_back(i);
        M[i] = SC.size() - 1;
        if (i == cur) break;
      }
      sort(SC.back().begin(), SC.back().end());
      roots.pop();
    }
    if (art || (pre == -1 && conn > 1)) ART.push_back(cur);
  }
  void scc() {
    SC.clear(), BR.clear(), ART.clear(), M.resize(NV);
    ord.clear(), llink.clear(), inin.clear(), time = 0;
    ord.resize(NV);
    llink.resize(NV);
    inin.resize(NV);
    for (int i = 0; i < NV; i++)
      if (!ord[i]) dfs(i, -1);
    sort(BR.begin(), BR.end());
    sort(ART.begin(), ART.end());
  }
};
int N, M;
int G[404040];
int U[404040], V[404040], did[404040];
vector<int> E[404040];
map<pair<int, int>, int> MP;
SCC_BI scc;
int vis[404040];
vector<int> E2[404040];
int C[404040];
void dfs(int cur, int pre) {
  if (vis[cur]) return;
  vis[cur] = 1;
  for (auto& r : E[cur])
    if (r != pre) {
      int x = MP[{cur, r}];
      if (did[x]) continue;
      U[x] = r;
      V[x] = cur;
      did[x] = 1;
      dfs(r, cur);
    }
}
void solve() {
  int i, j, k, l, r, x, y;
  string s;
  scanf("%d%d", &N, &M);
  scc.init(N);
  for (i = 0; i < (M); i++) {
    scanf("%d%d", &U[i], &V[i]);
    U[i]--;
    V[i]--;
    E[U[i]].push_back(V[i]);
    E[V[i]].push_back(U[i]);
    MP[{U[i], V[i]}] = MP[{V[i], U[i]}] = i;
    scc.add_edge(U[i], V[i]);
  }
  scc.scc();
  int ma = 0;
  for (i = 0; i < (scc.SC.size()); i++)
    if (scc.SC[i].size() > scc.SC[ma].size()) ma = i;
  (void)printf("%d\n", scc.SC[ma].size());
  dfs(scc.SC[ma][0], -1);
  for (i = 0; i < (M); i++) (void)printf("%d %d\n", U[i] + 1, V[i] + 1);
}
int main(int argc, char** argv) {
  string s;
  int i;
  if (argc == 1) ios::sync_with_stdio(false), cin.tie(0);
  for (i = 0; i < (argc - 1); i++) s += argv[i + 1], s += '\n';
  for (i = 0; i < (s.size()); i++) ungetc(s[s.size() - 1 - i], stdin);
  solve();
  return 0;
}