#include <bits/stdc++.h>
using namespace std;
inline long long qr() {
  long long x = 0, f = 1;
  char ch;
  while (!isdigit(ch = getchar()))
    if (ch == '-') f = -1;
  for (; isdigit(ch); x = x * 10 + ch - 48, ch = getchar())
    ;
  return x * f;
}
const int N = 400010;
int n, m, u[N], v[N];
int dfn[N], low[N], idx, g[N << 1], sz[N], c[N];
int h[N], to[N << 1], nx[N << 1], f[N << 1], ct = 1;
bool vis[N];
void add(int x, int y) {
  to[++ct] = y;
  nx[ct] = h[x];
  h[x] = ct;
}
void tarjan(int u, int ff) {
  dfn[u] = low[u] = ++idx;
  for (int i = h[u]; i; i = nx[i]) {
    int v = to[i];
    if (!dfn[v]) {
      tarjan(v, i);
      if (f[i] == 0 && f[i ^ 1] == 0) f[i] = 1;
      low[u] = min(low[u], low[v]);
      if (dfn[u] < low[v]) {
        g[i] = g[i ^ 1] = 1;
        f[i] = f[i ^ 1] = 0;
      }
    } else if (i != (ff ^ 1)) {
      if (f[i] == 0 && f[i ^ 1] == 0) f[i] = 1;
      low[u] = min(low[u], dfn[v]);
    }
  }
}
void bfs(int u, int k) {
  queue<int> q;
  q.push(u);
  c[u] = k;
  sz[k] = 1;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = h[u]; i; i = nx[i]) {
      int v = to[i];
      if (!c[v] && !g[i]) {
        c[v] = k;
        sz[k]++;
        q.push(v);
      }
    }
  }
}
void dfs(int u) {
  vis[u] = 1;
  for (int i = h[u]; i; i = nx[i]) {
    int v = to[i];
    if (!vis[v]) {
      if (c[u] != c[v]) f[i] = 1;
      dfs(v);
    }
  }
}
int main() {
  n = qr(), m = qr();
  for (int i = 1; i <= m; ++i) {
    u[i] = qr(), v[i] = qr();
    add(u[i], v[i]);
    add(v[i], u[i]);
  }
  tarjan(1, 0);
  int mx = 0, s, p = 0;
  for (int i = 1; i <= n; ++i) {
    if (!c[i]) bfs(i, ++p);
    if (sz[p] > mx) mx = sz[p], s = p;
  }
  printf("%d\n", mx);
  for (int i = 1; i <= n; ++i)
    if (!vis[i] && c[i] == s) {
      dfs(i);
      break;
    }
  for (int i = 2; i <= ct; i += 2) {
    if (f[i] == 0)
      printf("%d %d\n", u[i / 2], v[i / 2]);
    else
      printf("%d %d\n", v[i / 2], u[i / 2]);
  }
  return 0;
}
