#include <bits/stdc++.h>
using namespace std;
const int N = 400100;
struct edge {
  int next, to;
  edge(int next = 0, int to = 0) : next(next), to(to) {}
} e[N << 1];
bool mark[N << 1], vis[N];
int pa[N], head[N], n, m, cnt, top, tot = 1;
int dfn[N], low[N], sta[N], bel[N], size[N], nm, sym[N];
inline void in(int &x) {
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    ;
  for (x = 0; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - 48;
}
inline void add(int x, int y) { e[++tot] = edge(head[x], y), head[x] = tot; }
void tarjan(int x, int fa) {
  dfn[x] = low[x] = ++cnt, sta[++top] = x;
  int i, y;
  for (i = head[x]; i; i = e[i].next) {
    y = e[i].to;
    if (y == fa) continue;
    if (!dfn[y]) {
      tarjan(y, x);
      if (low[y] > dfn[x]) {
        size[++nm] = 0, sym[nm] = y;
        while (low[sta[top]] > dfn[x]) {
          bel[sta[top]] = nm;
          ++size[nm], --top;
        }
      }
      if (low[y] < low[x]) low[x] = low[y];
    } else if (dfn[y] < low[x])
      low[x] = dfn[y];
  }
}
void redir(int x) {
  int i, y;
  vis[x] = 1;
  for (i = head[x]; i; i = e[i].next)
    if (!mark[i]) {
      y = e[i].to, mark[i ^ 1] = 1;
      if (!vis[y]) redir(y);
    }
}
int main() {
  in(n), in(m);
  int i, j, x, y;
  for (i = 1; i <= m; ++i) in(x), in(y), add(x, y), add(y, x);
  tarjan(1, 0);
  if (top) {
    size[++nm] = 0, sym[nm] = 1;
    while (top) {
      ++size[nm];
      bel[sta[top]] = nm, --top;
    }
  }
  for (x = 0, y = 0, i = 1; i <= nm; ++i)
    if (size[i] > x) x = size[i], y = i;
  redir(sym[y]);
  cout << x << endl;
  for (i = 1; i <= m; ++i) {
    x = e[i << 1].to, y = e[i << 1 | 1].to;
    if (mark[i << 1])
      printf("%d %d\n", y, x);
    else
      printf("%d %d\n", x, y);
  }
  return 0;
}
