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;
const int mxn = 400001;
int n, m;
bool used[mxn];
struct edge {
  int to, n;
};
vector<edge> e[mxn];
int tin[mxn], fup[mxn], timer = 0;
bool br[mxn];
void dfsbr(int v, int p) {
  used[v] = 1;
  tin[v] = fup[v] = timer++;
  for (auto ed : e[v]) {
    if (ed.to == p) {
      continue;
    }
    if (used[ed.to]) {
      fup[v] = min(fup[v], tin[ed.to]);
    } else {
      dfsbr(ed.to, v);
      fup[v] = min(fup[v], fup[ed.to]);
      if (fup[ed.to] > tin[v]) {
        br[ed.n] = 1;
      }
    }
  }
}
vector<edge> ec[mxn];
int color[mxn], d[mxn], colors = 0, st[mxn], en[mxn], csz[mxn];
void dfscl(int v, int c) {
  used[v] = 1;
  color[v] = c;
  for (auto ed : e[v]) {
    if (used[ed.to]) {
      if (st[ed.n] != v) {
        swap(st[ed.n], en[ed.n]);
      }
      continue;
    }
    if (br[ed.n]) {
      int nc = colors++;
      ec[c].push_back({nc, ed.n});
      ec[nc].push_back({c, ed.n});
      dfscl(ed.to, nc);
    } else {
      if (st[ed.n] != v) {
        swap(st[ed.n], en[ed.n]);
      }
      dfscl(ed.to, c);
    }
  }
}
void clr() {
  for (int i = 0; i < n; i++) {
    used[i] = 0;
  }
}
struct cmp {
  bool operator()(int a, int b) {
    if (d[a] != d[b]) {
      return d[a] < d[b];
    }
    if (csz[a] != csz[b]) {
      return csz[a] < csz[b];
    }
    return a < b;
  }
};
int main() {
  cin >> n >> m;
  int x, y;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    st[i] = x;
    en[i] = y;
    e[x].push_back({y, i});
    e[y].push_back({x, i});
  }
  for (int i = 0; i < n; i++) {
    if (!used[i]) {
      dfsbr(i, -1);
    }
  }
  clr();
  for (int i = 0; i < n; i++) {
    if (!used[i]) {
      dfscl(i, colors++);
    }
  }
  clr();
  for (int i = 0; i < n; i++) {
    csz[color[i]]++;
  }
  int ans = 0;
  set<int, cmp> s;
  for (int i = 0; i < colors; i++) {
    d[i] = ec[i].size();
    s.insert(i);
    ans = max(ans, csz[i]);
  }
  while (!s.empty()) {
    int v = *s.begin();
    s.erase(s.begin());
    used[v] = 1;
    for (auto ed : ec[v]) {
      if (!used[ed.to]) {
        s.erase(ed.to);
        d[ed.to]--;
        s.insert(ed.to);
        if (color[st[ed.n]] != v) {
          swap(st[ed.n], en[ed.n]);
        }
      }
    }
  }
  cout << ans << '\n';
  for (int i = 0; i < m; i++) {
    cout << st[i] + 1 << ' ' << en[i] + 1 << '\n';
  }
  return 0;
}