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;
template <class T>
struct rge {
  T b, e;
};
template <class T>
rge<T> range(T i, T j) {
  return rge<T>{i, j};
}
template <class T>
auto dud(T *x) -> decltype(cerr << *x, 0);
template <class T>
char dud(...);
struct debug {
  template <class T>
  debug &operator<<(const T &) {
    return *this;
  }
};
const int N = 4e5 + 5;
struct dsu {
  vector<int> pr, tot;
  dsu(int n = 0) : pr(n + 5), tot(n + 5, 1) { iota(pr.begin(), pr.end(), 0); }
  int find(int u) { return pr[u] == u ? u : pr[u] = find(pr[u]); }
  void unite(int u, int v) {
    u = find(u), v = find(v);
    if (u != v) {
      pr[v] = u;
      tot[u] += tot[v];
    }
  }
  int reached(int u) { return tot[find(u)]; }
};
vector<int> graph[N];
vector<pair<int, int> > edges;
map<pair<int, int>, pair<int, int> > dir;
bool vis[N];
int tin[N], fup[N];
dsu dg(N);
int timer = 0;
int n, m;
void bridges(int u, int pr = 0) {
  tin[u] = fup[u] = ++timer;
  for (int v : graph[u])
    if (v != pr) {
      if (!tin[v]) {
        bridges(v, u);
        fup[u] = min(fup[u], fup[v]);
        if (fup[v] > tin[u])
          debug() << "bridge"
                     " "
                  << "u"
                     ": "
                  << (u)
                  << " "
                     "->"
                     " "
                  << "v"
                     ": "
                  << (v) << " ";
        else {
          dir[{u, v}] = dir[{v, u}] = {u, v};
          dg.unite(u, v);
        }
      }
      fup[u] = min(fup[u], tin[v]);
      if (tin[v] < tin[u]) dir[{u, v}] = dir[{v, u}] = {u, v};
    }
}
void dfs(int u, int pr = 0) {
  vis[u] = 1;
  for (int v : graph[u])
    if (!vis[v]) {
      if (!dir.count({u, v})) dir[{u, v}] = dir[{v, u}] = {v, u};
      dfs(v, u);
    }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (auto i = (0) - ((0) > (m)); i != m - ((0) > (m));
       i += 1 - 2 * ((0) > (m))) {
    int u, v;
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
    edges.push_back({u, v});
  }
  bridges(1);
  int z = 1;
  for (auto u = (1) - ((1) > (n + 1)); u != n + 1 - ((1) > (n + 1));
       u += 1 - 2 * ((1) > (n + 1)))
    if (dg.reached(u) > dg.reached(z)) z = u;
  debug() << " "
          << "z"
             ": "
          << (z)
          << " "
             " "
          << "dg.reached(z)"
             ": "
          << (dg.reached(z)) << " ";
  dfs(z);
  cout << dg.reached(z) << '\n';
  for (auto &[u, v] : edges) {
    auto it = dir[{u, v}];
    cout << it.first << " " << it.second << '\n';
  }
  return 0;
}