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;
const long long MAXN = 4e5 + 10;
vector<pair<long long, long long> > tree[MAXN];
vector<pair<long long, long long> > vertex[MAXN];
pair<long long, long long> res[MAXN];
long long c[MAXN];
long long p[MAXN];
long long dp[MAXN];
long long height[MAXN];
long long parent[MAXN];
bool edge[MAXN];
bool check[MAXN];
void edge_cut(long long v, long long h) {
  check[v] = true;
  height[v] = h;
  dp[v] = v;
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (check[vertex[v][i].first] && vertex[v][i].first != parent[v]) {
      if (height[vertex[v][i].first] < height[dp[v]]) {
        dp[v] = vertex[v][i].first;
      }
    }
  }
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first]) {
      parent[vertex[v][i].first] = v;
      edge_cut(vertex[v][i].first, h + 1);
      if (height[dp[vertex[v][i].first]] > height[v]) {
        edge[vertex[v][i].second] = true;
      }
      if (height[dp[vertex[v][i].first]] < height[dp[v]]) {
        dp[v] = dp[vertex[v][i].first];
      }
    }
  }
}
void dfs(long long v, long long id) {
  check[v] = true;
  c[v] = id;
  p[id]++;
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first] && !edge[vertex[v][i].second]) {
      dfs(vertex[v][i].first, id);
    }
  }
}
void o_dfs(long long v) {
  check[v] = true;
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first]) {
      if (c[v] != c[vertex[v][i].first]) {
        res[vertex[v][i].second] = make_pair(vertex[v][i].first, v);
      }
      o_dfs(vertex[v][i].first);
    }
  }
}
void i_dfs(long long v) {
  check[v] = true;
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (check[vertex[v][i].first] && parent[v] != vertex[v][i].first) {
      res[vertex[v][i].second] = make_pair(v, vertex[v][i].first);
    }
  }
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first] && !edge[vertex[v][i].second]) {
      res[vertex[v][i].second] = make_pair(v, vertex[v][i].first);
      parent[vertex[v][i].first] = v;
      i_dfs(vertex[v][i].first);
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, id = 1;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long v, u;
    cin >> v >> u;
    vertex[v].push_back(make_pair(u, id));
    vertex[u].push_back(make_pair(v, id++));
  }
  edge_cut(1, 0);
  fill(check, check + MAXN, false);
  fill(parent, parent + MAXN, 0);
  for (long long i = 1; i <= n; i++) {
    if (!check[i]) {
      i_dfs(i);
    }
  }
  fill(check, check + MAXN, false);
  id = 1;
  for (long long i = 1; i <= n; i++) {
    if (!check[i]) {
      dfs(i, id++);
    }
  }
  fill(check, check + MAXN, false);
  long long t = 0, e = 0;
  for (long long i = 1; i <= n; i++) {
    if (t < p[c[i]]) {
      t = p[c[i]];
      e = i;
    }
  }
  fill(check, check + MAXN, false);
  o_dfs(e);
  cout << t << endl;
  for (long long i = 1; i <= m; i++) {
    cout << res[i].first << " " << res[i].second << endl;
  }
}