#include <bits/stdc++.h>
const int MaxN = 4e5 + 50;
template <class t>
inline void read(t &s) {
  s = 0;
  register int f = 1;
  register char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) s = (s << 3) + (s << 1) + (c ^ 48), c = getchar();
  s *= f;
  return;
}
template <class t, class... A>
inline void read(t &x, A &...a) {
  read(x);
  read(a...);
}
template <class t>
inline void write(t x) {
  if (x < 0) putchar('-'), x = -x;
  int buf[21], top = 0;
  while (x) buf[++top] = x % 10, x /= 10;
  if (!top) buf[++top] = 0;
  while (top) putchar(buf[top--] ^ '0');
  return;
}
inline void setIn(std::string s) {
  freopen(s.c_str(), "r", stdin);
  return;
}
inline void setOut(std::string s) {
  freopen(s.c_str(), "w", stdout);
  return;
}
inline void setIO(std::string s = "") {
  setIn(s + ".in");
  setOut(s + ".out");
  return;
}
template <class t>
inline bool checkmin(t &x, t y) {
  if (x > y) {
    x = y;
    return 1;
  }
  return 0;
}
template <class t>
inline bool checkmax(t &x, t y) {
  if (x < y) {
    x = y;
    return 1;
  }
  return 0;
}
inline int lowbit(int x) { return x & (-x); }
struct Edge {
  int u, v;
  std::pair<int, int> ed;
} e[MaxN];
std::map<std::pair<int, int>, int> rev;
std::map<std::pair<int, int>, std::pair<int, std::pair<int, int> > > Rev;
std::vector<int> E[MaxN], G[MaxN], dr[MaxN];
int dfn[MaxN], low[MaxN], sta[MaxN], vis[MaxN], top, dfncnt, n, m;
int s[MaxN], col[MaxN], scc;
int yes[MaxN];
inline void tarjan(int u, int fa) {
  dfn[u] = low[u] = ++dfncnt, sta[top++] = u, vis[u] = 1;
  for (auto v : E[u])
    if (v != fa) {
      if (!dfn[v])
        tarjan(v, u), checkmin(low[u], low[v]);
      else if (vis[v])
        checkmin(low[u], dfn[v]);
    }
  if (dfn[u] == low[u]) {
    ++scc;
    do
      --top, vis[sta[top]] = 0, ++s[scc], col[sta[top]] = scc,
             dr[scc].push_back(sta[top]);
    while (sta[top] != u);
  }
}
inline void yunica(int u) {
  for (auto v : E[u])
    if (yes[v]) {
      if (!vis[v])
        vis[v] = 1, e[rev[std::make_pair(u, v)]].ed = std::make_pair(u, v),
        yunica(v);
      else if (!e[rev[std::make_pair(u, v)]].ed.first)
        e[rev[std::make_pair(u, v)]].ed = std::make_pair(u, v);
    }
}
inline void dfs(int u, int fa) {
  for (auto v : G[u])
    if (v != fa)
      e[Rev[std::make_pair(u, v)].first].ed = Rev[std::make_pair(u, v)].second,
                              dfs(v, u);
}
signed main(void) {
  read(n, m);
  for (int i = 1; i <= m; ++i)
    read(e[i].u, e[i].v), E[e[i].u].push_back(e[i].v),
        E[e[i].v].push_back(e[i].u),
        rev[std::make_pair(e[i].u, e[i].v)] =
            rev[std::make_pair(e[i].v, e[i].u)] = i;
  for (int i = 1; i <= n; ++i)
    if (!dfn[i]) top = 0, tarjan(i, 0);
  for (int i = 1; i <= scc; ++i) {
    for (auto j : dr[i]) yes[j] = 1, vis[j] = 0;
    yunica(dr[i][0]);
    for (auto j : dr[i]) yes[j] = 0;
  }
  for (int u = 1; u <= n; ++u)
    for (auto v : E[u])
      if (col[u] != col[v])
        Rev[std::make_pair(col[u], col[v])].first = rev[std::make_pair(u, v)],
                                   Rev[std::make_pair(col[u], col[v])].second =
                                       std::make_pair(v, u),
                                   G[col[u]].push_back(col[v]);
  register int ans = 0, pos = 0;
  for (int i = 1; i <= scc; ++i)
    if (checkmax(ans, s[i])) pos = i;
  dfs(pos, 0);
  write(ans), std::puts("");
  for (int i = 1; i <= m; ++i)
    write(e[i].ed.first), std::putchar(32), write(e[i].ed.second),
        std::puts("");
  return 0;
}
