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;
int n, m;
bool artPoint[400005];
vector<pair<int, int> > bridges;
int par[400005], num[400005], low[400005];
int cnt;
vector<int> G[400005];
int N = 6;
void dfsArticulationPointsAndBridges(int u) {
  num[u] = low[u] = cnt++;
  for (int i = 0; i < (int)G[u].size(); i++) {
    int v = G[u][i];
    if (num[v] == -1) {
      par[v] = u;
      dfsArticulationPointsAndBridges(v);
      if (num[u] <= low[v]) artPoint[u] = 1;
      if (num[u] < low[v]) bridges.push_back(make_pair(u, v));
      low[u] = min(low[u], low[v]);
    } else if (par[u] != v)
      low[u] = min(low[u], num[v]);
  }
}
vector<pair<int, int> > edges;
vector<int> v[400005], v2[400005];
map<pair<int, int>, int> is_bridge;
bool vis[400005];
int id[400005], siz[400005];
map<pair<int, int>, pair<int, int> > ans;
void dfs(int s, int idx, int pa) {
  vis[s] = 1;
  id[s] = idx;
  siz[idx]++;
  for (int i = 0; i < v2[s].size(); i++) {
    int u = v2[s][i];
    if (ans.find({s, u}) == ans.end()) {
      ans[{s, u}] = ans[{u, s}] = {s, u};
    }
    if (!vis[u]) dfs(u, idx, s);
  }
}
bool vis2[400005];
map<pair<int, int>, pair<int, int> > ma;
void dfs2(int s, int pa) {
  vis2[s] = 1;
  if (pa != -1) {
    ma[{pa, s}] = ma[{s, pa}] = {s, pa};
  }
  for (int i = 0; i < v[s].size(); i++) {
    int u = v[s][i];
    if (!vis2[u]) {
      dfs2(u, s);
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cnt = 0;
  memset(num, -1, sizeof num);
  memset(par, -1, sizeof par);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
    edges.push_back({x, y});
  }
  dfsArticulationPointsAndBridges(1);
  for (int i = 0; i < bridges.size(); i++) {
    int x = bridges[i].first;
    int y = bridges[i].second;
    is_bridge[{x, y}] = 1;
    is_bridge[{y, x}] = 1;
  }
  for (int i = 0; i < m; i++) {
    int x = edges[i].first;
    int y = edges[i].second;
    if (is_bridge.find({x, y}) == is_bridge.end()) {
      v2[x].push_back(y);
      v2[y].push_back(x);
    }
  }
  int idx = 1;
  int mx = 0;
  int kh = 1;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      dfs(i, idx, -1);
      if (siz[idx] > mx) {
        mx = siz[idx];
        kh = idx;
      }
      idx++;
    }
  }
  for (int i = 0; i < bridges.size(); i++) {
    int x = bridges[i].first;
    int y = bridges[i].second;
    v[id[x]].push_back(id[y]);
    v[id[y]].push_back(id[x]);
  }
  dfs2(kh, -1);
  for (int i = 0; i < bridges.size(); i++) {
    int x = bridges[i].first;
    int y = bridges[i].second;
    int id1 = id[x];
    int id2 = id[y];
    if (ma[{id1, id2}].first == id1 && ma[{id1, id2}].second == id2) {
      ans[{x, y}] = ans[{y, x}] = {x, y};
    } else {
      ans[{x, y}] = ans[{y, x}] = {y, x};
    }
  }
  cout << mx << endl;
  for (int i = 0; i < edges.size(); i++) {
    int x = edges[i].first;
    int y = edges[i].second;
    cout << ans[{x, y}].first << " " << ans[{x, y}].second << endl;
  }
  return 0;
}