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;
template <class T>
inline void checkmin(T &a, const T &b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, const T &b) {
  if (b > a) a = b;
}
const int inf = 1e9 + 10;
const int maxn = 4e5 + 10;
int parent[maxn], low[maxn], num[maxn], id[maxn], sz[maxn], n, m, cnt = 0,
                                                                  totcir = 0;
vector<pair<int, int> > g[maxn], adj[maxn], e, edge;
vector<int> cir[maxn];
stack<int> stk;
map<pair<int, int>, bool> Map;
bool col[maxn];
void tarjan(int x) {
  low[x] = num[x] = ++cnt;
  stk.push(x);
  for (int i = 0; i < g[x].size(); i++) {
    int to = g[x][i].first, idx = g[x][i].second;
    if (!num[to]) {
      parent[to] = x;
      tarjan(to);
      low[x] = min(low[x], low[to]);
    } else if (to != parent[x]) {
      low[x] = min(low[x], num[to]);
    }
  }
  if (low[x] == num[x]) {
    while ((!stk.empty()) && stk.top() != x) {
      id[stk.top()] = totcir;
      cir[totcir].push_back(stk.top());
      stk.pop();
    }
    cir[totcir].push_back(stk.top());
    id[stk.top()] = totcir;
    stk.pop();
    totcir++;
  }
}
void dfs(int x, int fa) {
  for (int i = 0; i < adj[x].size(); i++) {
    int to = adj[x][i].first, idx = adj[x][i].second;
    if (to == fa) continue;
    int u = e[idx].first, v = e[idx].second;
    if (to != id[u]) swap(u, v);
    Map[make_pair(u, v)] = 1;
    dfs(to, x);
  }
}
void setedge(int x) {
  num[x] = ++cnt;
  for (int i = 0; i < g[x].size(); i++) {
    int to = g[x][i].first, idx = g[x][i].second;
    if (!col[to]) continue;
    if (!num[to]) {
      num[to] = ++cnt;
      setedge(to);
      Map[make_pair(x, to)] = 1;
    } else if (to != parent[x] && num[to] < num[x]) {
      Map[make_pair(x, to)] = 1;
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--;
    v--;
    g[u].push_back(make_pair(v, i));
    g[v].push_back(make_pair(u, i));
    e.push_back(make_pair(u, v));
  }
  parent[0] = -1;
  tarjan(0);
  for (int i = 0; i < totcir; i++) {
    for (int j = 0; j < cir[i].size(); j++) {
      int x = cir[i][j];
      col[x] = 1;
      num[x] = 0;
    }
    setedge(cir[i][cir[i].size() - 1]);
    for (int j = 0; j < cir[i].size(); j++) col[cir[i][j]] = 0;
  }
  for (int i = 0; i < e.size(); i++) {
    int u = e[i].first, v = e[i].second;
    if (id[u] != id[v]) {
      adj[id[u]].push_back(make_pair(id[v], i));
      adj[id[v]].push_back(make_pair(id[u], i));
    }
  }
  for (int i = 0; i < totcir; i++) sz[i] = (int)cir[i].size();
  int maxval = 0, maxnum = -1;
  for (int i = 0; i < totcir; i++)
    if (maxval < sz[i]) {
      maxval = sz[i];
      maxnum = i;
    }
  dfs(maxnum, -1);
  printf("%d\n", maxval);
  for (int i = 0; i < e.size(); i++) {
    int u = e[i].first, v = e[i].second;
    if (Map.find(make_pair(u, v)) != Map.end()) {
      printf("%d %d\n", u + 1, v + 1);
    } else {
      printf("%d %d\n", v + 1, u + 1);
    }
  }
  return 0;
}