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;
int n, m, visited[400010], num[400010], low[400010], dfsCount = 0, par[400010],
                                                     grId[400010];
int slg = 0, grMax = 0, idGM = 0;
stack<int> st;
vector<pair<int, int> > bridges, es;
map<pair<int, int>, int> edges;
vector<int> adj[400010], dirs;
vector<vector<pair<int, pair<int, int> > > > eds;
void findBridges(int u) {
  num[u] = low[u] = dfsCount;
  dfsCount++;
  visited[u] = 1;
  st.push(u);
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i];
    if (visited[v] == 0) {
      par[v] = u;
      findBridges(v);
      low[u] = min(low[u], low[v]);
      if (low[v] > num[u]) {
        bridges.push_back(pair<int, int>(u, v));
        slg++;
        int t = 1;
        while (st.top() != v) {
          grId[st.top()] = slg;
          st.pop();
          t++;
        }
        if (t > grMax) grMax = t, idGM = slg;
        grId[v] = slg;
        st.pop();
      } else {
        int x = edges[pair<int, int>(u, v)];
        if (x == 0) {
          int y = edges[pair<int, int>(v, u)];
          dirs[y] = 1;
        }
      }
    } else {
      if (par[u] != v) {
        low[u] = min(low[u], low[v]);
        if (visited[v] == 1) {
          int x = edges[pair<int, int>(u, v)];
          if (x == 0) {
            int y = edges[pair<int, int>(v, u)];
            dirs[y] = 1;
          }
        }
      }
    }
  }
  visited[u] = 2;
}
void duyet(int u, int pre) {
  for (int i = 0; i < eds[u].size(); i++) {
    int v = eds[u][i].first;
    if (v != pre) {
      int x = eds[u][i].second.first, y = eds[u][i].second.second;
      int al = edges[pair<int, int>(y, x)];
      if (!al) {
        dirs[edges[pair<int, int>(x, y)]] = 1;
      }
      duyet(v, u);
    }
  }
}
void solve() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    edges[pair<int, int>(x, y)] = i + 1;
    es.push_back(pair<int, int>(x, y));
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dirs.assign(m + 1, 0);
  for (int i = 1; i <= n; i++)
    sort(adj[i].begin(), adj[i].end()), visited[i] = 0;
  findBridges(1);
  slg++;
  int t = 0;
  while (!st.empty()) {
    int x = st.top();
    st.pop();
    grId[x] = slg;
    t++;
  }
  if (t > grMax) grMax = t, idGM = slg;
  eds.assign(slg + 1, vector<pair<int, pair<int, int> > >());
  for (int i = 0; i < bridges.size(); i++) {
    int u = bridges[i].first, v = bridges[i].second;
    eds[grId[u]].push_back(
        pair<int, pair<int, int> >(grId[v], pair<int, int>(u, v)));
    eds[grId[v]].push_back(
        pair<int, pair<int, int> >(grId[u], pair<int, int>(v, u)));
  }
  duyet(idGM, 0);
  cout << grMax << endl;
  for (int i = 1; i <= m; i++) {
    int u = es[i - 1].first, v = es[i - 1].second;
    if (dirs[i])
      cout << v << " " << u << endl;
    else
      cout << u << " " << v << endl;
  }
}
int main() {
  solve();
  return 0;
}