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 double eps = 0.000000000000001;
string convertstring(long long n) {
  stringstream ss;
  ss << n;
  return ss.str();
}
int U[400005], V[400005], disc[400005], low[400005], t, comp_no[400005],
    comp_sz[400005];
bool is_bridge[400005];
vector<int> g[400005];
int adj(int u, int edge_id) { return U[edge_id] ^ V[edge_id] ^ u; }
void tarjan(int src, int par_edge) {
  disc[src] = low[src] = ++t;
  for (int i = 0; i < g[src].size(); ++i) {
    int edge_id = g[src][i];
    if (edge_id == par_edge) continue;
    int v = adj(src, edge_id);
    if (!disc[v]) {
      tarjan(v, edge_id);
      low[src] = min(low[src], low[v]);
      if (low[v] > disc[src]) is_bridge[edge_id] = 1;
    } else {
      low[src] = min(low[src], disc[v]);
    }
  }
}
int c_id, outdeg[400005];
vector<int> btree[400005];
vector<pair<int, pair<int, int> > > poop;
bool marked[400005];
void bridge_tree(int src) {
  comp_no[src] = c_id;
  comp_sz[c_id]++;
  for (int i = 0; i < g[src].size(); ++i) {
    int edge_id = g[src][i];
    if (is_bridge[edge_id]) continue;
    int v = adj(src, edge_id);
    if (!marked[edge_id])
      poop.push_back(make_pair(edge_id, make_pair(src, v))),
          marked[edge_id] = 1;
    if (!comp_no[v]) bridge_tree(v);
  }
}
map<pair<int, int>, int> mm;
void DFS(int src, int par) {
  for (int i = 0; i < btree[src].size(); ++i) {
    if (btree[src][i] == par) {
      int edge_id = mm[make_pair(src, par)], u, v;
      u = U[edge_id], v = V[edge_id];
      if (comp_no[u] == par) swap(v, u);
      poop.push_back(make_pair(edge_id, make_pair(u, v)));
    } else
      DFS(btree[src][i], src);
  }
}
int main() {
  int n, m, i, j;
  scanf("%d%d", &n, &m);
  ;
  for (i = 1; i <= m; ++i) {
    scanf("%d%d", &U[i], &V[i]);
    ;
    g[U[i]].push_back(i);
    g[V[i]].push_back(i);
  }
  for (i = 1; i <= n; ++i) {
    if (!disc[i]) tarjan(i, 0);
  }
  int mx = 0, ind = -1;
  for (i = 1; i <= n; ++i) {
    if (!comp_no[i]) {
      ++c_id;
      bridge_tree(i);
      if (comp_sz[c_id] > mx) {
        mx = comp_sz[c_id];
        ind = c_id;
      }
    }
  }
  printf("%d\n", mx);
  for (i = 1; i <= m; ++i) {
    if (is_bridge[i]) {
      btree[comp_no[U[i]]].push_back(comp_no[V[i]]);
      btree[comp_no[V[i]]].push_back(comp_no[U[i]]);
      mm[make_pair(comp_no[U[i]], comp_no[V[i]])] = i;
      mm[make_pair(comp_no[V[i]], comp_no[U[i]])] = i;
    }
  }
  if (ind != -1) {
    DFS(ind, 0);
  }
  sort(poop.begin(), poop.end());
  for (i = 0; i < poop.size(); ++i)
    printf("%d %d\n", poop[i].second.first, poop[i].second.second);
  return 0;
}