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 n, m, k, mo, db;
vector<vector<pair<int, int> > > sor;
vector<int> eleres, legfelso, osszefuggokomponensdarabszam, erintettuk, apa;
vector<bool> volt;
vector<vector<pair<int, int> > > hidelek;
vector<pair<int, int> > utak;
vector<pair<int, pair<int, int> > > vegsomo;
bool nagyobb(pair<int, int> a, pair<int, int> b) {
  if (a.first > b.first) return true;
  if (a.first == b.first && a.second > b.second) return true;
  return false;
}
bool tartalmaz(int a, int b, int hanyadik) {
  if (hidelek[a].size() == 0) return false;
  int l = 0, r = hidelek[a].size() - 1;
  while (l != r) {
    int koztes = (l + r + 1) / 2;
    if (nagyobb(hidelek[a][koztes], {hanyadik, b}))
      r = koztes - 1;
    else
      l = koztes;
  }
  if (hidelek[a][l].first == hanyadik && hidelek[a][l].second == b)
    return true;
  else
    return false;
}
void bejaras(int hely, int szulo) {
  apa[hely] = szulo;
  volt[hely] = true;
  eleres[hely] = k;
  legfelso[hely] = k;
  k++;
  for (pair<int, int> x : sor[hely]) {
    if (x.second == szulo) continue;
    if (volt[x.second] == false) {
      bejaras(x.second, hely);
      legfelso[hely] = min(legfelso[hely], legfelso[x.second]);
      if (eleres[hely] < legfelso[x.second]) {
        hidelek[hely].push_back(make_pair(x.first, x.second));
        hidelek[x.second].push_back(make_pair(x.first, hely));
      }
    } else {
      legfelso[hely] = min(legfelso[hely], eleres[x.second]);
    }
  }
}
void dfs(int hely) {
  erintettuk.push_back(hely);
  db++;
  volt[hely] = true;
  for (pair<int, int> x : sor[hely]) {
    if (tartalmaz(hely, x.second, x.first) == false && volt[x.second] == false)
      dfs(x.second);
  }
}
void osszefuggokomponensekrendezese(int hely, int szulo) {
  volt[hely] = true;
  k++;
  eleres[hely] = k;
  for (pair<int, int> x : sor[hely]) {
    if (x.second == szulo) continue;
    if (volt[x.second] == false) {
      vegsomo.push_back(make_pair(x.first, make_pair(x.second, hely)));
      osszefuggokomponensekrendezese(x.second, hely);
    } else {
      if (eleres[hely] > eleres[x.second])
        vegsomo.push_back(make_pair(x.first, make_pair(x.second, hely)));
    }
  }
}
int main() {
  cin >> n >> m;
  k = 1, mo = 0, db = 0;
  sor.assign(n, vector<pair<int, int> >(0));
  eleres.assign(n, 0);
  legfelso.assign(n, 0);
  volt.assign(n, false);
  hidelek.assign(n, vector<pair<int, int> >(0));
  osszefuggokomponensdarabszam.assign(n, -1);
  erintettuk.assign(0, 0);
  apa.assign(n, -1);
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    utak.push_back(make_pair(u, v));
    sor[u].push_back({i, v});
    sor[v].push_back({i, u});
  }
  bejaras(0, -1);
  for (int i = 0; i < n; i++) {
    sort(hidelek[i].begin(), hidelek[i].end());
  }
  for (int i = 0; i < n; i++) {
    sort(sor[i].begin(), sor[i].end());
  }
  volt.assign(n, false);
  for (int i = 0; i < n; i++) {
    if (volt[i] == true) continue;
    db = 0;
    erintettuk.assign(0, 0);
    dfs(i);
    for (int x : erintettuk) osszefuggokomponensdarabszam[x] = db;
  }
  for (int x : osszefuggokomponensdarabszam) mo = max(mo, x);
  cout << mo << endl;
  int index;
  for (int i = 0; i < n; i++) {
    if (osszefuggokomponensdarabszam[i] == mo) {
      index = i;
      break;
    }
  }
  volt.assign(n, false);
  k = 0;
  eleres.assign(n, -1);
  osszefuggokomponensekrendezese(index, -1);
  sort(vegsomo.begin(), vegsomo.end());
  for (int i = 0; i < vegsomo.size(); i++) {
    if (i == 0)
      cout << vegsomo[i].second.first + 1 << " " << vegsomo[i].second.second + 1
           << endl;
    if (i != 0)
      if (vegsomo[i].second != vegsomo[i - 1].second)
        cout << vegsomo[i].second.first + 1 << " "
             << vegsomo[i].second.second + 1 << endl;
  }
  return 0;
}