#include <bits/stdc++.h>
using namespace std;
constexpr int N = 400010;
int n, m, in_largest_comp, largest_comp_size = 0;
struct edge {
  int i, v;
};
vector<pair<int, int> > Ans(N);
vector<edge> G[N];
int L[N], H[N], ND[N], ID[N];
void find_bridges(int cur, int par, int id) {
  ID[cur] = id;
  ND[cur] = 1;
  L[cur] = id;
  H[cur] = id;
  for (edge e : G[cur]) {
    auto v = e.v;
    if (v != par) {
      if (L[v] == -1) {
        find_bridges(v, cur, id + ND[cur]);
        ND[cur] += ND[v];
        H[cur] = max(H[cur], H[v]);
        L[cur] = min(L[v], L[cur]);
      } else {
        H[cur] = max(H[cur], ID[v]);
        L[cur] = min(L[cur], ID[v]);
      }
    }
  }
}
bool vis[N];
int find_component(int cur, int par) {
  vis[cur] = true;
  int res = 1;
  for (edge e : G[cur]) {
    auto v = e.v;
    if (vis[v]) {
      continue;
    }
    res += find_component(v, cur);
  }
  if (res > largest_comp_size) {
    largest_comp_size = res;
    in_largest_comp = cur;
  }
  if (L[cur] == ID[cur] && H[cur] < ID[cur] + ND[cur]) {
    return 0;
  }
  return res;
}
bool used_edges[N], visNode[N];
struct params {
  int cur, par, i;
};
void dfs() {
  vector<params> stack;
  stack.push_back({in_largest_comp, -1, -1});
  while (!stack.empty()) {
    auto cur = stack.back().cur;
    auto par = stack.back().par;
    auto i = stack.back().i;
    stack.pop_back();
    if (i != -1 && used_edges[i]) continue;
    if (par != -1) {
      used_edges[i] = true;
      if (ND[cur] < ND[par]) {
        if (L[cur] == ID[cur] && H[cur] < ID[cur] + ND[cur]) {
          Ans[i] = {cur, par};
        } else {
          Ans[i] = {par, cur};
        }
      } else {
        if (L[par] == ID[par] && H[par] < ID[par] + ND[par]) {
          Ans[i] = {cur, par};
        } else {
          Ans[i] = {par, cur};
        }
      }
    }
    if (visNode[cur]) continue;
    visNode[cur] = true;
    for (edge e : G[cur]) {
      auto v = e.v;
      auto i = e.i;
      if (used_edges[i]) {
        continue;
      }
      stack.push_back({v, cur, i});
    }
  }
}
int main() {
  memset(&L, -1, sizeof(L));
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back({i, v});
    G[v].push_back({i, u});
  }
  find_bridges(1, -1, 1);
  find_component(1, -1);
  dfs();
  printf("%d\n", largest_comp_size);
  for (int i = 0; i < m; i++) {
    printf("%d %d\n", Ans[i].first, Ans[i].second);
  }
  return 0;
}
