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;
vector<vector<pair<int, int>>> v;
vector<int> aresta;
int entry[400005];
int low[400005];
bool vis[400005];
int at = 1;
vector<pair<int, int>> res;
void dfs(int no, int p) {
  entry[no] = low[no] = at++;
  for (auto i : v[no]) {
    if (i.first == p) continue;
    if (!entry[i.first]) {
      dfs(i.first, no);
      low[no] = min(low[i.first], low[no]);
      if (low[i.first] > entry[no]) aresta[i.second] = -1;
    }
    low[no] = min(low[no], entry[i.first]);
  }
}
int dfs(int no) {
  vis[no] = 1;
  int r = 1;
  for (auto i : v[no]) {
    if (vis[i.first] || aresta[i.second] == -1) continue;
    r += dfs(i.first);
  }
  return r;
}
void solve(int no, int p) {
  vis[no] = 1;
  for (auto i : v[no]) {
    if (aresta[i.second] >= 1) continue;
    if (aresta[i.second] == -1) {
      aresta[i.second] = 2;
      res[i.second] = {i.first + 1, no + 1};
    } else {
      aresta[i.second] == 1;
      res[i.second] = {no + 1, i.first + 1};
    }
    if (!vis[i.first]) solve(i.first, no);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  v.resize(n);
  aresta.resize(m);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    v[a - 1].push_back({b - 1, i});
    v[b - 1].push_back({a - 1, i});
  }
  dfs(0, -1);
  res.resize(m);
  int t = 0, id = 0;
  for (int i = 0; i < n; i++) {
    int x;
    if (!vis[i] && (x = dfs(i)) > t) {
      t = x;
      id = i;
    }
  }
  memset(vis, 0, sizeof vis);
  solve(id, -1);
  cout << t << endl;
  for (auto i : res) cout << i.first << " " << i.second << endl;
}