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;
void read(int &x) {
  register char ch = getchar();
  x = 0;
  for (; ch == ' ' || ch == '\n'; ch = getchar())
    ;
  for (; ch != ' ' && ch != '\n'; x = x * 10 + ch - '0', ch = getchar())
    ;
}
void write(int x) {
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int n, m, K, tms, cnt, rt, maxx, u[400004], v[400004];
int vis[400004], low[400004], cmp[400004], siz[400004];
stack<int> st;
vector<int> g[400004], num[400004];
void dfs(int x, int par) {
  vis[x] = low[x] = ++tms, st.push(x);
  bool parnum = 0;
  for (int i = 0; i < g[x].size(); i++)
    if (g[x][i] != par) {
      if (!vis[g[x][i]])
        dfs(g[x][i], x), low[x] = min(low[x], low[g[x][i]]);
      else
        low[x] = min(low[x], vis[g[x][i]]);
    }
  if (low[x] == vis[x]) {
    ++cnt;
    while (1) {
      int u = st.top();
      cmp[u] = cnt, siz[cnt]++;
      st.pop();
      if (u == x) break;
    }
    if (maxx < siz[cnt]) maxx = siz[cnt], rt = cnt;
  }
}
queue<int> que, que1;
bool used[400004], vis1[400004];
int ans[400004];
void dfs1(int x, int par, int w) {
  vis1[x] = 1;
  for (int i = 0; i < g[x].size(); i++)
    if (g[x][i] != par) {
      if (w != cmp[g[x][i]] && !used[cmp[g[x][i]]]) {
        ans[num[x][i]] = g[x][i];
        que.push(cmp[g[x][i]]), que1.push(g[x][i]);
        continue;
      }
      if (vis1[g[x][i]]) {
        if (ans[num[x][i]] < 1) ans[num[x][i]] = x;
        continue;
      }
      ans[num[x][i]] = x, dfs1(g[x][i], x, w);
    }
}
void ansmake(int x, int root) {
  que.push(x), que1.push(root);
  while (!que.empty()) {
    int uu = que.front(), rt_ = que1.front();
    que.pop(), que1.pop();
    used[uu] = 1;
    dfs1(rt_, -1, uu);
  }
}
int main() {
  read(n), read(m);
  for (int i = 0; i < m; i++) {
    read(u[i]), read(v[i]);
    g[u[i]].push_back(v[i]);
    g[v[i]].push_back(u[i]);
    num[u[i]].push_back(i);
    num[v[i]].push_back(i);
  }
  dfs(1, -1);
  write(maxx), puts("");
  int root;
  for (int i = 1; i <= n; i++)
    if (rt == cmp[i]) {
      root = i;
      break;
    }
  ansmake(rt, root);
  for (int i = 0; i < m; i++)
    write(ans[i]), putchar(' '), write(u[i] + v[i] - ans[i]), puts("");
}