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;
mt19937 gen(chrono::system_clock::now().time_since_epoch().count());
const int N = 4e5 + 10;
const long long MOD = 1e9 + 7;
const int rx[4] = {-1, 0, 1, 0};
const int ry[4] = {0, 1, 0, -1};
const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int hx[8] = {-2, -2, -1, 1, 2, 2, 1, -1};
const int hy[8] = {-1, 1, 2, 2, 1, -1, -2, -2};
const long double eps = 1e-7;
const double pi = acos(-1.0);
const int INF = 1e9;
vector<int> g[N], g2[N];
int timer = 1, tin[N], tin2[N], tout[N], fup[N];
bool used[N], used2[N], used3[N], used4[N];
unordered_map<long long, int> bridge, nom;
unordered_map<long long, pair<int, int> > nwbr;
int comp_kol, comp[N], comp_sz[N];
vector<pair<int, pair<int, int> > > ans;
void dfs_bridge(int v, int p = -1) {
  tin[v] = timer++;
  fup[v] = tin[v];
  used[v] = true;
  for (auto to : g[v]) {
    if (to == p) continue;
    if (used[to]) {
      fup[v] = min(fup[v], tin[to]);
    } else {
      dfs_bridge(to, v);
      fup[v] = min(fup[v], fup[to]);
      if (fup[to] > tin[v]) {
        bridge[v * 1000000ll + to] = true;
        bridge[to * 1000000ll + v] = true;
      }
    }
  }
}
void dfs_comp(int v, int p, int cmp) {
  comp[v] = cmp;
  used2[v] = true;
  for (auto to : g[v]) {
    if (bridge[v * 1000000ll + to]) {
      if (used2[to]) {
        g2[comp[v] - 1].push_back(comp[to] - 1);
        nwbr[{(comp[v] - 1) * 1000000ll + comp[to] - 1}] = {v, to};
      } else {
        comp_kol++;
        g2[comp[v] - 1].push_back(comp_kol - 1);
        nwbr[{(comp[v] - 1) * 1000000ll + comp_kol - 1}] = {v, to};
        dfs_comp(to, v, comp_kol);
      }
    } else if (!used2[to])
      dfs_comp(to, v, cmp);
  }
}
void dfs_cycl(int v, int p = -1) {
  used4[v] = true;
  tin[v] = timer++;
  for (auto to : g[v]) {
    if (bridge[v * 1000000ll + to] || to == p) continue;
    if (tin[to] < tin[v]) {
      ans.push_back({nom[v * 1000000ll + to], {v, to}});
    }
    if (used4[to]) continue;
    dfs_cycl(to, v);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    nom[x * 1000000ll + y] = i;
    nom[y * 1000000ll + x] = i;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs_bridge(0);
  comp_kol++;
  dfs_comp(0, -1, 1);
  for (int i = 0; i < n; i++) {
    comp[i]--;
    comp_sz[comp[i]]++;
    tin[i] = 0;
  }
  int mx = 0;
  for (int i = 0; i < comp_kol; i++) {
    if (comp_sz[i] > comp_sz[mx]) mx = i;
  }
  cout << comp_sz[mx] << '\n';
  used3[mx] = true;
  queue<int> q;
  q.push(mx);
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (auto to : g2[v]) {
      if (!used3[to]) {
        used3[to] = true;
        q.push(to);
        int x = nwbr[v * 1000000ll + to].first,
            y = nwbr[v * 1000000ll + to].second;
        ans.push_back({nom[x * 1000000ll + y], {y, x}});
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (!used4[i]) {
      timer = 1;
      dfs_cycl(i);
    }
  }
  sort(ans.begin(), ans.end());
  for (auto it : ans)
    cout << it.second.first + 1 << " " << it.second.second + 1 << '\n';
  return 0;
}