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>
const int MaxN = 4e5 + 50;
template <class t>
inline void read(t &s) {
  s = 0;
  register int f = 1;
  register char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) s = (s << 3) + (s << 1) + (c ^ 48), c = getchar();
  s *= f;
  return;
}
template <class t, class... A>
inline void read(t &x, A &...a) {
  read(x);
  read(a...);
}
template <class t>
inline void write(t x) {
  if (x < 0) putchar('-'), x = -x;
  int buf[21], top = 0;
  while (x) buf[++top] = x % 10, x /= 10;
  if (!top) buf[++top] = 0;
  while (top) putchar(buf[top--] ^ '0');
  return;
}
inline void setIn(std::string s) {
  freopen(s.c_str(), "r", stdin);
  return;
}
inline void setOut(std::string s) {
  freopen(s.c_str(), "w", stdout);
  return;
}
inline void setIO(std::string s = "") {
  setIn(s + ".in");
  setOut(s + ".out");
  return;
}
template <class t>
inline bool checkmin(t &x, t y) {
  if (x > y) {
    x = y;
    return 1;
  }
  return 0;
}
template <class t>
inline bool checkmax(t &x, t y) {
  if (x < y) {
    x = y;
    return 1;
  }
  return 0;
}
inline int lowbit(int x) { return x & (-x); }
struct Edge {
  int u, v;
  std::pair<int, int> ed;
} e[MaxN];
std::map<std::pair<int, int>, int> rev;
std::map<std::pair<int, int>, std::pair<int, std::pair<int, int> > > Rev;
std::vector<int> E[MaxN], G[MaxN], dr[MaxN];
int dfn[MaxN], low[MaxN], sta[MaxN], vis[MaxN], top, dfncnt, n, m;
int s[MaxN], col[MaxN], scc;
int yes[MaxN];
inline void tarjan(int u, int fa) {
  dfn[u] = low[u] = ++dfncnt, sta[top++] = u, vis[u] = 1;
  for (auto v : E[u])
    if (v != fa) {
      if (!dfn[v])
        tarjan(v, u), checkmin(low[u], low[v]);
      else if (vis[v])
        checkmin(low[u], dfn[v]);
    }
  if (dfn[u] == low[u]) {
    ++scc;
    do
      --top, vis[sta[top]] = 0, ++s[scc], col[sta[top]] = scc,
             dr[scc].push_back(sta[top]);
    while (sta[top] != u);
  }
}
inline void yunica(int u) {
  for (auto v : E[u])
    if (yes[v]) {
      if (!vis[v])
        vis[v] = 1, e[rev[std::make_pair(u, v)]].ed = std::make_pair(u, v),
        yunica(v);
      else if (!e[rev[std::make_pair(u, v)]].ed.first)
        e[rev[std::make_pair(u, v)]].ed = std::make_pair(u, v);
    }
}
inline void dfs(int u, int fa) {
  for (auto v : G[u])
    if (v != fa)
      e[Rev[std::make_pair(u, v)].first].ed = Rev[std::make_pair(u, v)].second,
                              dfs(v, u);
}
signed main(void) {
  read(n, m);
  for (int i = 1; i <= m; ++i)
    read(e[i].u, e[i].v), E[e[i].u].push_back(e[i].v),
        E[e[i].v].push_back(e[i].u),
        rev[std::make_pair(e[i].u, e[i].v)] =
            rev[std::make_pair(e[i].v, e[i].u)] = i;
  for (int i = 1; i <= n; ++i)
    if (!dfn[i]) top = 0, tarjan(i, 0);
  for (int i = 1; i <= scc; ++i) {
    for (auto j : dr[i]) yes[j] = 1, vis[j] = 0;
    yunica(dr[i][0]);
    for (auto j : dr[i]) yes[j] = 0;
  }
  for (int u = 1; u <= n; ++u)
    for (auto v : E[u])
      if (col[u] != col[v])
        Rev[std::make_pair(col[u], col[v])].first = rev[std::make_pair(u, v)],
                                   Rev[std::make_pair(col[u], col[v])].second =
                                       std::make_pair(v, u),
                                   G[col[u]].push_back(col[v]);
  register int ans = 0, pos = 0;
  for (int i = 1; i <= scc; ++i)
    if (checkmax(ans, s[i])) pos = i;
  dfs(pos, 0);
  write(ans), std::puts("");
  for (int i = 1; i <= m; ++i)
    write(e[i].ed.first), std::putchar(32), write(e[i].ed.second),
        std::puts("");
  return 0;
}