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 N = 400005;
const int M = 800005;
vector<pair<int, int> > ans;
set<pair<int, int> > s;
struct Edge {
  int u, v, id;
  bool iscut;
  Edge() {}
  Edge(int u, int v, int id) {
    this->u = u;
    this->v = v;
    this->iscut = false;
    this->id = id;
  }
  bool operator<(const Edge& c) const {
    if (u != c.u) return u < c.u;
    return v < c.v;
  }
};
struct BCC {
  int n;
  Edge edge[M];
  int en, first[N], next[M];
  int pre[N], dfn[N], bccno[N], bccn, dfs_clock;
  int val[N];
  Edge cut[M];
  int cutn;
  void init(int n) {
    this->n = n;
    memset(first, -1, sizeof(first));
    en = 0;
  }
  void add_Edge(int u, int v, int id) {
    edge[en] = Edge(u, v, id);
    next[en] = first[u];
    first[u] = en++;
  }
  void dfs_cut(int u, int fa) {
    pre[u] = dfn[u] = ++dfs_clock;
    for (int i = first[u]; i + 1; i = next[i]) {
      int v = edge[i].v;
      if (edge[i].id == fa) continue;
      if (!pre[v]) {
        dfs_cut(v, edge[i].id);
        dfn[u] = min(dfn[u], dfn[v]);
        if (dfn[v] > pre[u]) {
          edge[i].iscut = edge[i ^ 1].iscut = true;
          cut[cutn++] = edge[i];
        }
      } else
        dfn[u] = min(dfn[u], pre[v]);
    }
  }
  void find_cut() {
    dfs_clock = cutn = 0;
    memset(pre, 0, sizeof(pre));
    for (int i = 0; i < n; i++)
      if (!pre[i]) dfs_cut(i, -1);
  }
  int use[M];
  void dfs_bcc(int u, int fa) {
    pre[u] = 1;
    val[bccn]++;
    bccno[u] = bccn;
    for (int i = first[u]; i + 1; i = next[i]) {
      int v = edge[i].v;
      if (edge[i].iscut) continue;
      if (use[edge[i].id] == 0) {
        use[edge[i].id] = 1;
        ans.push_back(make_pair(u, v));
      }
      if (pre[v]) continue;
      dfs_bcc(v, edge[i].id);
    }
  }
  void find_bcc() {
    bccn = 0;
    memset(pre, 0, sizeof(pre));
    for (int i = 0; i < n; i++) {
      if (!pre[i]) {
        dfs_bcc(i, -1);
        bccn++;
      }
    }
  }
  vector<pair<int, pair<int, int> > > g[N];
  int fa[N];
  int find(int x) {
    if (x == fa[x]) return x;
    return fa[x] = find(fa[x]);
  }
  void go(int u, int p) {
    for (int i = 0; i < g[u].size(); i++) {
      int v = g[u][i].first;
      if (v == p) continue;
      go(v, u);
      ans.push_back(make_pair(g[u][i].second.second, g[u][i].second.first));
    }
  }
  void solve() {
    find_cut();
    find_bcc();
    for (int i = 0; i < bccn; i++) {
      fa[i] = i;
      g[i].clear();
    }
    for (int i = 0; i < n; i++) {
      for (int j = first[i]; j + 1; j = next[j]) {
        int u = edge[j].u, v = edge[j].v;
        u = bccno[u];
        v = bccno[v];
        if (u == v) continue;
        int pu = find(u);
        int pv = find(v);
        if (pu != pv) {
          g[u].push_back(make_pair(v, make_pair(edge[j].u, edge[j].v)));
          g[v].push_back(make_pair(u, make_pair(edge[j].v, edge[j].u)));
          fa[pu] = pv;
        }
      }
    }
    int Max = 0;
    for (int i = 0; i < bccn; i++) Max = max(Max, val[i]);
    for (int i = 0; i < bccn; i++) {
      if (val[i] == Max) {
        go(i, i);
        break;
      }
    }
    printf("%d\n", Max);
    for (int i = 0; i < ans.size(); i++) {
      s.insert(make_pair(ans[i].first + 1, ans[i].second + 1));
    }
  }
} gao;
int n, m;
int U[N], V[N];
int main() {
  scanf("%d%d", &n, &m);
  gao.init(n);
  int u, v;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    U[i] = u;
    V[i] = v;
    u--;
    v--;
    gao.add_Edge(u, v, i);
    gao.add_Edge(v, u, i);
  }
  gao.solve();
  for (int i = 0; i < m; i++) {
    if (s.find(make_pair(U[i], V[i])) != s.end())
      printf("%d %d\n", U[i], V[i]);
    else
      printf("%d %d\n", V[i], U[i]);
  }
  return 0;
}