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;
bool vis[400010];
long long n, m, lw[400010], din[400010], tp[400010], cnt = 0, ans[400010],
                                                     mxnd = -1;
vector<pair<long long, long long> > vt[400010], bri, vt2[400010], ed;
vector<long long> sz[400010];
map<long long, long long> mp;
void dfs(long long x, long long lst, long long ed) {
  vis[x] = true;
  lw[x] = din[x] = ++cnt;
  long long i;
  for (i = 0; i < vt[x].size(); i++) {
    if (vt[x][i].first != lst) {
      if (vis[vt[x][i].first]) {
        lw[x] = min(lw[x], din[vt[x][i].first]);
      } else {
        dfs(vt[x][i].first, x, vt[x][i].second);
        lw[x] = min(lw[x], lw[vt[x][i].first]);
      }
    }
  }
  if (lw[x] == din[x] && x != 0) {
    bri.push_back(make_pair(min(x, lst) * n + max(x, lst), ed));
    mp[min(x, lst) * n + max(x, lst)] = 1;
  }
  return;
}
void dfs2(long long x) {
  vis[x] = true;
  tp[x] = cnt;
  long long i;
  for (i = 0; i < vt[x].size(); i++) {
    if (mp[min(x, vt[x][i].first) * n + max(x, vt[x][i].first)] == 1) {
      continue;
    }
    ans[vt[x][i].second] = x * n + vt[x][i].first;
    if (vis[vt[x][i].first]) {
      continue;
    }
    dfs2(vt[x][i].first);
  }
  sz[cnt].push_back(x);
  return;
}
void dfs3(long long x, long long lst) {
  long long i;
  for (i = 0; i < vt2[x].size(); i++) {
    if (vt2[x][i].first != lst) {
      if (tp[ed[vt2[x][i].second].second] == x) {
        ans[vt2[x][i].second] =
            ed[vt2[x][i].second].first * n + ed[vt2[x][i].second].second;
      } else {
        ans[vt2[x][i].second] =
            ed[vt2[x][i].second].second * n + ed[vt2[x][i].second].first;
      }
      dfs3(vt2[x][i].first, x);
    }
  }
  return;
}
int main() {
  long long i, j, x, y, mx;
  scanf("%lld%lld", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%lld%lld", &x, &y);
    x--;
    y--;
    vt[x].push_back(make_pair(y, i));
    vt[y].push_back(make_pair(x, i));
    ed.push_back(make_pair(x, y));
  }
  dfs(0, -1, -1);
  memset(vis, false, sizeof(vis));
  cnt = 0;
  for (i = 0; i < n; i++) {
    if (!vis[i]) {
      dfs2(i);
      cnt++;
    }
  }
  mx = 0;
  for (i = 0; i < cnt; i++) {
    if (sz[i].size() > mx) {
      mx = sz[i].size();
      mxnd = i;
    }
  }
  for (i = 0; i < bri.size(); i++) {
    x = bri[i].first / n;
    y = bri[i].first % n;
    x = tp[x];
    y = tp[y];
    vt2[x].push_back(make_pair(y, bri[i].second));
    vt2[y].push_back(make_pair(x, bri[i].second));
  }
  dfs3(mxnd, -1);
  printf("%lld\n", mx);
  for (i = 0; i < ed.size(); i++) {
    printf("%lld %lld\n", ans[i] / n + 1, ans[i] % n + 1);
  }
  return 0;
}