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
#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 100;
int in() {
  int x;
  scanf("%d", &x);
  return x;
}
int n, m, d[N], h[N], mark[N], cut[N], sz[N];
struct edge {
  int i, u;
};
struct edge2 {
  int u, v;
} ans[N];
vector<edge> adj[N];
int sum[N], l, r, mid;
void dfs(int c, int p) {
  sz[c] = 1;
  mark[c] = true;
  d[c] = h[c];
  for (auto ne : adj[c]) {
    if (ne.u == p) continue;
    if (mark[ne.u]) {
      if (h[ne.u] < h[c]) ans[ne.i].u = c, ans[ne.i].v = ne.u;
      d[c] = min(d[c], d[ne.u]);
      continue;
    }
    ans[ne.i].u = c, ans[ne.i].v = ne.u;
    h[ne.u] = h[c] + 1;
    dfs(ne.u, c);
    d[c] = min(d[c], d[ne.u]);
    if (d[ne.u] == h[ne.u]) cut[ne.u] = ne.i;
    sz[c] += sz[ne.u];
  }
}
bool dfs2(int c, int p) {
  mark[c] = true;
  for (auto ne : adj[c]) {
    if (mark[ne.u]) continue;
    dfs2(ne.u, c);
    sum[c] += sum[ne.u];
  }
  int mn = N;
  if (cut[c]) {
    mn = sum[c];
    if (c == 0) return (mn >= mid);
    if (mn < mid) {
      ans[cut[c]].u = c, ans[cut[c]].v = p;
      sum[c] = 0;
    } else
      ans[cut[c]].u = p, ans[cut[c]].v = c;
  }
}
bool check(int x) {
  mid = x;
  for (int i = 0; i < n; i++) {
    mark[i] = false;
    sum[i] = 1;
  }
  cut[0] = N - 1;
  return dfs2(0, 0);
}
int main() {
  n = in(), m = in();
  for (int i = 0; i < n; i++) {
    d[i] = N + 1;
  }
  for (int i = 0; i < m; i++) {
    int u = in() - 1, v = in() - 1;
    edge c;
    c.i = i + 1;
    c.u = v;
    ans[i + 1].u = u, ans[i + 1].v = v;
    adj[u].push_back(c);
    c.u = u;
    adj[v].push_back(c);
  }
  dfs(0, 0);
  int l = 0, r = n + 1;
  while (r - l > 1) {
    mid = (l + r) / 2;
    if (check(mid))
      l = mid;
    else
      r = mid;
  }
  check(l);
  cout << l << endl;
  for (int i = 1; i <= m; i++)
    cout << ans[i].u + 1 << ' ' << ans[i].v + 1 << endl;
}
