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;
using pii = pair<int, int>;
using ll = long long;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using ld = long double;
const int MN = 4e5 + 2, BASE = 131, MOD = 1e9 + 7;
int d[MN], low[MN], tt, wotbcc[MN], sz[MN];
bool vis[MN];
struct Edge {
  int to, a, b;
};
vector<int> adj[MN], bcc[MN];
vector<Edge> bccadj[MN];
set<int> dir[MN];
void dfs(int cur, int p = -1) {
  d[cur] = low[cur] = ++tt;
  for (int i : adj[cur])
    if (i != p) {
      if (!d[i]) {
        dfs(i, cur);
        low[cur] = min(low[cur], low[i]);
        if (low[i] != d[i]) bcc[i].push_back(cur), bcc[cur].push_back(i);
      } else
        low[cur] = min(low[cur], d[i]), bcc[i].push_back(cur),
        bcc[cur].push_back(i);
    }
}
void dfs2(int cur) {
  vis[cur] = 1;
  sz[wotbcc[cur] = tt]++;
  for (int i : bcc[cur]) {
    if (!vis[i]) {
      dir[cur].insert(i);
      dfs2(i);
    } else if (!dir[i].count(cur) && !dir[cur].count(i)) {
      dir[cur].insert(i);
    }
  }
}
void dfs3(int cur, int p = -1) {
  for (Edge &e : bccadj[cur])
    if (e.to != p) {
      dir[e.b].insert(e.a);
      dfs3(e.to, cur);
    }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  vector<pii> edges;
  while (m--) {
    int a, b;
    scanf("%d %d", &a, &b);
    adj[a].push_back(b);
    adj[b].push_back(a);
    edges.emplace_back(a, b);
  }
  dfs(1);
  tt = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      ++tt;
      dfs2(i);
    }
  int mx = 0, wot = -1;
  for (int i = 1; i <= tt; i++)
    if (sz[i] > mx) {
      mx = sz[i];
      wot = i;
    }
  printf("%d\n", mx);
  for (pii p : edges)
    if (!dir[p.first].count(p.second) && !dir[p.second].count(p.first))
      bccadj[wotbcc[p.first]].push_back({wotbcc[p.second], p.first, p.second}),
          bccadj[wotbcc[p.second]].push_back(
              {wotbcc[p.first], p.second, p.first});
  dfs3(wot);
  for (pii &p : edges) {
    if (dir[p.first].count(p.second))
      printf("%d %d\n", p.first, p.second);
    else
      printf("%d %d\n", p.second, p.first);
  }
  return 0;
}