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 GCC optimize("O3")
#pragma GCC target("avx")
using namespace std;
int n;
int m;
int low[400002];
int ord[400002];
bool use[400002];
vector<pair<int, int> > v[400002];
set<pair<int, int> > v2[400002];
bool ng[400002];
inline void dfs(int b, int &siz, int pr = -1) {
  use[b] = true;
  ord[b] = siz;
  low[b] = siz;
  siz++;
  for (int i = 0; i < v[b].size(); i++) {
    int &go = v[b][i].first;
    if (go == pr) continue;
    if (use[go]) {
      ng[v[b][i].second] = true;
      low[b] = min(low[b], ord[v[b][i].first]);
      continue;
    }
    dfs(go, siz, b);
    low[b] = min(low[b], low[go]);
    if (ord[b] > low[go]) {
      ng[v[b][i].second] = true;
    }
  }
}
vector<pair<int, int> > ed;
int belong[400002];
int cnt[400002];
inline int root(int b) {
  if (belong[b] == -1) {
    return b;
  }
  belong[b] = root(belong[b]);
  return belong[b];
}
void merge(int a, int b) {
  a = root(a);
  b = root(b);
  if (a == b) return;
  belong[a] = b;
  cnt[b] += cnt[a];
}
bool vis[400002];
inline void dfs4(int b, int target) {
  if (vis[b]) return;
  vis[b] = true;
  for (int i = 0; i < v[b].size(); i++) {
    if (vis[v[b][i].first] == false) {
      if (root(v[b][i].first) != target) {
        auto tmp = v[b][i];
        if (ed[tmp.second].first == b) {
          swap(ed[tmp.second].first, ed[tmp.second].second);
        }
        dfs4(v[b][i].first, target);
      }
    }
  }
}
inline void dfs3(int b) {
  if (vis[b]) return;
  vis[b] = true;
  while (v2[b].size()) {
    auto tmp = (*v2[b].begin());
    v2[b].erase(tmp);
    if (use[tmp.second]) continue;
    if (root(tmp.first) != root(b)) {
      if (ed[tmp.second].first == b) {
        swap(ed[tmp.second].first, ed[tmp.second].second);
      }
      dfs4(tmp.first, root(b));
      continue;
    }
    use[tmp.second] = true;
    if (ed[tmp.second].first != b) {
      swap(ed[tmp.second].first, ed[tmp.second].second);
    }
    dfs3(tmp.first);
  }
}
int main() {
  memset(belong, -1, sizeof(belong));
  for (int i = 0; i < 400002; i++) cnt[i] = 1;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, vv;
    scanf("%d%d", &u, &vv);
    u--;
    vv--;
    v[u].push_back(make_pair(vv, i));
    v[vv].push_back(make_pair(u, i));
    v2[u].insert(make_pair(vv, i));
    v2[vv].insert(make_pair(u, i));
    ed.push_back(make_pair(u, vv));
  }
  int SIZ = 0;
  dfs(0, SIZ);
  int cntt = 0;
  for (int i = 0; i < m; i++) {
    if (ng[i]) {
      cntt++;
    }
  }
  if (cnt == 0) {
    puts("1");
    for (int i = 0; i < m; i++) {
      printf("%d %d\n", ed[i].first + 1, ed[i].second + 1);
    }
    return 0;
  }
  for (int i = 0; i < m; i++) {
    if (ng[i]) {
      merge(ed[i].first, ed[i].second);
    }
  }
  int MAXX = 0;
  int be = -1;
  for (int i = 0; i < n; i++) {
    MAXX = max(MAXX, cnt[root(i)]);
    if (MAXX == cnt[root(i)]) {
      be = root(i);
    }
  }
  memset(use, false, sizeof(use));
  dfs3(be);
  cout << MAXX << endl;
  for (int i = 0; i < ed.size(); i++) {
    printf("%d %d\n", ed[i].first + 1, ed[i].second + 1);
  }
  return 0;
}