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 MX = 400005;
int n, m;
vector<int> g[MX];
int dfs_num[MX], dfs_low[MX];
int vis_cntr;
int root_children, root;
int articulation_points[MX];
int vis[MX];
int component_cnt = 1;
int components[MX];
int components_map[MX];
set<pair<int, int> > bridges;
set<pair<int, pair<int, int> > > roads;
set<pair<int, pair<int, int> > > orig_roads;
int orientation[MX];
void dfs(int u, int pa) {
  dfs_num[u] = dfs_low[u] = vis_cntr++;
  for (int j = 0; j < g[u].size(); j++) {
    int v = g[u][j];
    if (v == pa) continue;
    if (dfs_num[v] == 0) {
      if (u == root) root_children++;
      dfs(v, u);
      if (dfs_low[v] >= dfs_num[u]) articulation_points[u] = 1;
      if (dfs_low[v] > dfs_num[u]) bridges.insert(make_pair(u, v));
      dfs_low[u] = min(dfs_low[u], dfs_low[v]);
    } else {
      dfs_low[u] = min(dfs_low[u], dfs_num[v]);
    }
  }
}
bool is_bridge(int u, int v) {
  return !(bridges.find(make_pair(u, v)) == bridges.end() &&
           bridges.find(make_pair(v, u)) == bridges.end());
}
void get_components(int u) {
  if (vis[u]) return;
  vis[u] = 1;
  components[u] = component_cnt;
  for (int j = 0; j < g[u].size(); j++) {
    int v = g[u][j];
    if (!is_bridge(u, v)) {
      get_components(v);
    }
  }
}
void assign(int u, int pa, int flag) {
  if (vis[u]) return;
  vis[u] = 1;
  for (int j = 0; j < g[u].size(); j++) {
    int rev_orientation = 0;
    int v = g[u][j];
    if (v == pa) continue;
    auto it = roads.lower_bound(make_pair(u, make_pair(v, 0)));
    if (it == roads.end() || it->first != u || it->second.first != v) {
      it = roads.lower_bound(make_pair(v, make_pair(u, 0)));
      rev_orientation = 1;
    }
    int road_num = it->second.second;
    int fflag = flag;
    if (is_bridge(u, v) && flag == 1) fflag = -1;
    assign(v, u, fflag);
    if (!orientation[road_num])
      orientation[road_num] = rev_orientation ? fflag * -1 : fflag;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
    roads.insert(make_pair(u, make_pair(v, i)));
    orig_roads.insert(make_pair(i, make_pair(u, v)));
  }
  for (int i = 1; i <= n; i++) {
    if (dfs_num[i] == 0) {
      vis_cntr = 1;
      root_children = 0;
      root = i;
      dfs(i, -1);
      articulation_points[i] = root_children > 1 ? 1 : 0;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      get_components(i);
      component_cnt++;
    }
  }
  for (int i = 1; i <= n; i++) {
    components_map[components[i]]++;
  }
  int maxc = 0, maxv = 0;
  for (int i = 1; i <= n; i++) {
    if (maxc < components_map[components[i]]) {
      maxc = components_map[components[i]];
      maxv = i;
    }
  }
  memset(vis, 0, sizeof(vis));
  assign(maxv, -1, 1);
  cout << maxc << endl;
  int c = 0;
  for (auto it = orig_roads.begin(); it != orig_roads.end(); it++, c++) {
    if (orientation[c] == 1)
      cout << it->second.first << " " << it->second.second << endl;
    else
      cout << it->second.second << " " << it->second.first << endl;
  }
  return 0;
}