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>
#pragma warning(disable : 4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;
struct Edge {
  int from;
  int dest;
  int id;
};
struct realEdge {
  int from;
  int dest;
  int id;
  int afrom;
  int adest;
};
map<pair<int, int>, int> memo;
struct bridge {
  vector<Edge> edges;
  vector<vector<int>> connect;
  vector<int> roots, st, order;
  int cnt;
  bool dfs(const vector<vector<Edge>> &g, int from, int parent) {
    order[from] = cnt++;
    st.push_back(from);
    roots.push_back(from);
    for (Edge e : g[from]) {
      int to = e.dest;
      if (to == parent) continue;
      if (order[to] == -1) {
        bool ok = dfs(g, to, from);
        if (ok) {
          memo[make_pair(from, to)] = true;
          memo[make_pair(to, from)] = false;
        }
      } else {
        if (memo.find(make_pair(from, to)) == memo.end()) {
          memo[make_pair(from, to)] = true;
          memo[make_pair(to, from)] = false;
        }
        while (order[roots.back()] > order[to]) roots.pop_back();
      }
    }
    if (from == roots.back()) {
      edges.push_back(Edge{parent, from});
      connect.push_back(vector<int>());
      while (true) {
        int w = st.back();
        st.pop_back();
        connect.back().push_back(w);
        if (from == w) break;
      }
      roots.pop_back();
      return false;
    }
    return true;
  }
  vector<Edge> get(const vector<vector<Edge>> &g) {
    const int n = g.size();
    edges.clear();
    connect.clear();
    roots.clear();
    st.clear();
    order.assign(n, -1);
    cnt = 0;
    for (int i = 0; i < n; i++) {
      if (order[i] != -1) continue;
      dfs(g, i, i);
      edges.pop_back();
    }
    return edges;
  }
} br;
struct UnionFind {
  vector<int> data;
  UnionFind(int size) : data(size, -1) {}
  bool unionSet(int x, int y) {
    x = root(x);
    y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y];
      data[y] = x;
    }
    return x != y;
  }
  bool findSet(int x, int y) { return root(x) == root(y); }
  int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); }
  int size(int x) { return -data[root(x)]; }
};
int N, M;
void dfs(const vector<vector<realEdge>> &es, int now, int from,
         map<pair<int, int>, int> &memo) {
  for (auto &&e : es[now]) {
    if (e.dest != from) {
      memo[make_pair(e.afrom, e.adest)] = false;
      memo[make_pair(e.adest, e.afrom)] = true;
      dfs(es, e.dest, e.from, memo);
    }
  }
}
void solve(vector<vector<Edge>> &es) {
  vector<pair<int, int>> anss(M);
  br.get(es);
  vector<int> belongs(N);
  int max_size = 0;
  int max_size_id = -1;
  for (int j = 0; j < br.connect.size(); ++j) {
    auto con = br.connect[j];
    for (auto n : con) {
      belongs[n] = j;
    }
    if (con.size() > max_size) {
      max_size = con.size();
      max_size_id = j;
    }
  }
  vector<vector<realEdge>> realedges(br.connect.size());
  for (auto e : br.edges) {
    if (belongs[e.from] != belongs[e.dest]) {
      realedges[belongs[e.from]].push_back(
          realEdge{belongs[e.from], belongs[e.dest], e.id, e.from, e.dest});
      realedges[belongs[e.dest]].push_back(
          realEdge{belongs[e.dest], belongs[e.from], e.id, e.dest, e.from});
    }
  }
  dfs(realedges, max_size_id, -1, memo);
  for (auto ee : es) {
    for (auto e : ee) {
      if (memo.find(make_pair(e.from, e.dest)) == memo.end()) {
        assert(false);
        memo[make_pair(e.from, e.dest)] = true;
        memo[make_pair(e.dest, e.from)] = false;
        anss[e.id] = make_pair(e.from, e.dest);
      } else if (memo[make_pair(e.from, e.dest)]) {
        anss[e.id] = make_pair(e.from, e.dest);
      }
    }
  }
  cout << max_size << endl;
  if (max_size == 1) max_size = 0;
  for (auto ans : anss) {
    printf("%d %d\n", ans.first + 1, ans.second + 1);
  }
  int a = 1;
  a++;
}
int main() {
  cin >> N >> M;
  UnionFind uf(N);
  vector<vector<Edge>> es(N);
  for (int i = 0; i < M; ++i) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    es[u].push_back(Edge{u, v, i});
    es[v].push_back(Edge{v, u, i});
  }
  solve(es);
  return 0;
}