#include <bits/stdc++.h>
using namespace std;
const int maxn = 400010;
struct Edge {
  int s, t;
  int next;
  int vis;
  int id;
} edge[1000005];
int head[maxn], E;
void add_edge(int s, int t, int id) {
  edge[E].s = s;
  edge[E].t = t;
  edge[E].vis = 0;
  edge[E].id = id;
  edge[E].next = head[s];
  head[s] = E++;
}
int Btype, Time, N, M;
int dfn[maxn], low[maxn], Belong[maxn];
int st[maxn], Top;
int root, ans;
pair<int, int> ret[maxn];
void dfs(int s) {
  int i, t, id;
  st[++Top] = s;
  dfn[s] = low[s] = ++Time;
  for (i = head[s]; i != -1; i = edge[i].next) {
    if (edge[i].vis) continue;
    t = edge[i].t;
    edge[i].vis = edge[i ^ 1].vis = 1;
    ret[edge[i].id] = make_pair(t, s);
    if (!dfn[t]) {
      dfs(t);
    }
    low[s] = min(low[s], low[t]);
  }
  if (dfn[s] == low[s]) {
    Btype++;
    int cnt = 0;
    do {
      t = st[Top--];
      Belong[t] = Btype;
      cnt++;
    } while (t != s);
    if (cnt > ans) {
      ans = cnt;
      root = s;
    }
  }
}
void scc(int n, int root) {
  Time = 0;
  Btype = 0;
  Top = 0;
  memset(dfn, 0, sizeof(int) * (n + 1));
  dfs(root);
}
int main() {
  int n, m, a, b;
  scanf("%d%d", &n, &m);
  memset(head, -1, sizeof(head));
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    add_edge(a, b, i);
    add_edge(b, a, i);
  }
  scc(n, 1);
  printf("%d\n", ans);
  for (int i = 0; i < E; i += 2) {
    edge[i].vis = edge[i ^ 1].vis = 0;
  }
  scc(n, root);
  for (int i = 0; i < m; i++) {
    printf("%d %d\n", ret[i].first, ret[i].second);
  }
  return 0;
}
