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 int max_n = 400555, log_n = 32, max_m = 111, mod = 1000000007,
          inf = 1111111111;
int n, m, used[max_n], tin[max_n], fout[max_n], privet5, vertex[max_n], k,
    used1[max_n], ptr[max_n], used_ind[max_n];
vector<pair<int, int> > v[max_n];
vector<pair<pair<int, int>, pair<int, int> > > v1[max_n];
vector<pair<int, int> > bridge[max_n];
pair<int, int> res[max_n];
void dfs(int x, int p) {
  tin[x] = fout[x] = privet5++;
  used[x] = 1;
  int p1;
  for (int i = 0; i < v[x].size(); ++i) {
    int to = v[x][i].first;
    if (to == p) {
      p1 = i;
      continue;
    }
    if (used[to])
      fout[x] = min(fout[x], tin[to]);
    else {
      dfs(to, x);
      fout[x] = min(fout[x], fout[to]);
      if (fout[to] > tin[x]) {
        bridge[x].push_back(v[x][i]);
        used_ind[v[x][i].second] = 1;
      }
    }
  }
  if (fout[x] > tin[p]) {
    bridge[x].push_back(v[x][p1]);
  }
}
void dfs1(int x, int k) {
  if (!used[x]) {
    ptr[x] = k;
    vertex[k]++;
    for (int i = 0; i < bridge[x].size(); ++i) {
      v1[k].push_back(
          make_pair(bridge[x][i], make_pair(bridge[x][i].first, x)));
    }
  }
  used[x] = 1;
  while (v[x].size()) {
    pair<int, int> g = v[x].back();
    v[x].pop_back();
    int to = g.first;
    if (used_ind[g.second]) {
      continue;
    }
    used_ind[g.second] = 1;
    res[g.second] = make_pair(x, to);
    dfs1(to, k);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int g, h;
    scanf("%d%d", &g, &h);
    g--;
    h--;
    v[g].push_back(make_pair(h, i));
    v[h].push_back(make_pair(g, i));
  }
  dfs(0, -1);
  for (int i = 0; i < n; ++i) used[i] = 0;
  for (int i = 0; i < n; ++i)
    if (!used[i]) {
      dfs1(i, k++);
    }
  for (int i = 0; i < k; ++i) {
    for (int q = 0; q < v1[i].size(); ++q) {
      v1[i][q].first.first = ptr[v1[i][q].first.first];
    }
  }
  set<pair<int, int> > s;
  for (int i = 0; i < k; ++i) s.insert(make_pair(vertex[i], i));
  int ans = inf;
  while (s.size()) {
    pair<int, int> g = *s.rbegin();
    s.erase(g);
    used1[g.second] = 1;
    ans = min(ans, g.first);
    for (int i = 0; i < v1[g.second].size(); ++i) {
      int to = v1[g.second][i].first.first;
      if (!used1[to]) {
        int ind = v1[g.second][i].first.second;
        res[ind] = v1[g.second][i].second;
        s.erase(make_pair(vertex[to], to));
        vertex[to] += g.first;
        s.insert(make_pair(vertex[to], to));
      }
    }
  }
  cout << ans << "\n";
  for (int i = 0; i < m; ++i)
    printf("%d %d\n", res[i].first + 1, res[i].second + 1);
}