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;
constexpr int N = 400010;
int n, m, in_largest_comp, largest_comp_size = 0;
struct edge {
  int i, v;
};
vector<pair<int, int> > Ans(N);
vector<edge> G[N];
int L[N], H[N], ND[N], ID[N];
void find_bridges(int cur, int par, int id) {
  ID[cur] = id;
  ND[cur] = 1;
  L[cur] = id;
  H[cur] = id;
  for (edge e : G[cur]) {
    auto v = e.v;
    if (v != par) {
      if (L[v] == -1) {
        find_bridges(v, cur, id + ND[cur]);
        ND[cur] += ND[v];
        H[cur] = max(H[cur], H[v]);
        L[cur] = min(L[v], L[cur]);
      } else {
        H[cur] = max(H[cur], ID[v]);
        L[cur] = min(L[cur], ID[v]);
      }
    }
  }
}
bool vis[N];
int find_component(int cur, int par) {
  vis[cur] = true;
  int res = 1;
  for (edge e : G[cur]) {
    auto v = e.v;
    if (vis[v]) {
      continue;
    }
    res += find_component(v, cur);
  }
  if (res > largest_comp_size) {
    largest_comp_size = res;
    in_largest_comp = cur;
  }
  if (L[cur] == ID[cur] && H[cur] < ID[cur] + ND[cur]) {
    return 0;
  }
  return res;
}
bool used_edges[N], visNode[N];
struct params {
  int cur, par, i;
};
void dfs() {
  vector<params> stack;
  stack.push_back({in_largest_comp, -1, -1});
  while (!stack.empty()) {
    auto cur = stack.back().cur;
    auto par = stack.back().par;
    auto i = stack.back().i;
    stack.pop_back();
    if (i != -1 && used_edges[i]) continue;
    if (par != -1) {
      used_edges[i] = true;
      if (ND[cur] < ND[par]) {
        if (L[cur] == ID[cur] && H[cur] < ID[cur] + ND[cur]) {
          Ans[i] = {cur, par};
        } else {
          Ans[i] = {par, cur};
        }
      } else {
        if (L[par] == ID[par] && H[par] < ID[par] + ND[par]) {
          Ans[i] = {cur, par};
        } else {
          Ans[i] = {par, cur};
        }
      }
    }
    if (visNode[cur]) continue;
    visNode[cur] = true;
    for (edge e : G[cur]) {
      auto v = e.v;
      auto i = e.i;
      if (used_edges[i]) {
        continue;
      }
      stack.push_back({v, cur, i});
    }
  }
}
int main() {
  memset(&L, -1, sizeof(L));
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back({i, v});
    G[v].push_back({i, u});
  }
  find_bridges(1, -1, 1);
  find_component(1, -1);
  dfs();
  printf("%d\n", largest_comp_size);
  for (int i = 0; i < m; i++) {
    printf("%d %d\n", Ans[i].first, Ans[i].second);
  }
  return 0;
}