#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void checkmin(T &a, const T &b) {
  if (b < a) a = b;
}
template <class T>
inline void checkmax(T &a, const T &b) {
  if (b > a) a = b;
}
const int inf = 1e9 + 10;
const int maxn = 4e5 + 10;
int parent[maxn], low[maxn], num[maxn], id[maxn], sz[maxn], n, m, cnt = 0,
                                                                  totcir = 0;
vector<pair<int, int> > g[maxn], adj[maxn], e, edge;
vector<int> cir[maxn];
stack<int> stk;
map<pair<int, int>, bool> Map;
bool col[maxn];
void tarjan(int x) {
  low[x] = num[x] = ++cnt;
  stk.push(x);
  for (int i = 0; i < g[x].size(); i++) {
    int to = g[x][i].first, idx = g[x][i].second;
    if (!num[to]) {
      parent[to] = x;
      tarjan(to);
      low[x] = min(low[x], low[to]);
    } else if (to != parent[x]) {
      low[x] = min(low[x], num[to]);
    }
  }
  if (low[x] == num[x]) {
    while ((!stk.empty()) && stk.top() != x) {
      id[stk.top()] = totcir;
      cir[totcir].push_back(stk.top());
      stk.pop();
    }
    cir[totcir].push_back(stk.top());
    id[stk.top()] = totcir;
    stk.pop();
    totcir++;
  }
}
void dfs(int x, int fa) {
  for (int i = 0; i < adj[x].size(); i++) {
    int to = adj[x][i].first, idx = adj[x][i].second;
    if (to == fa) continue;
    int u = e[idx].first, v = e[idx].second;
    if (to != id[u]) swap(u, v);
    Map[make_pair(u, v)] = 1;
    dfs(to, x);
  }
}
void setedge(int x) {
  num[x] = ++cnt;
  for (int i = 0; i < g[x].size(); i++) {
    int to = g[x][i].first, idx = g[x][i].second;
    if (!col[to]) continue;
    if (!num[to]) {
      num[to] = ++cnt;
      setedge(to);
      Map[make_pair(x, to)] = 1;
    } else if (to != parent[x] && num[to] < num[x]) {
      Map[make_pair(x, to)] = 1;
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--;
    v--;
    g[u].push_back(make_pair(v, i));
    g[v].push_back(make_pair(u, i));
    e.push_back(make_pair(u, v));
  }
  parent[0] = -1;
  tarjan(0);
  for (int i = 0; i < totcir; i++) {
    for (int j = 0; j < cir[i].size(); j++) {
      int x = cir[i][j];
      col[x] = 1;
      num[x] = 0;
    }
    setedge(cir[i][cir[i].size() - 1]);
    for (int j = 0; j < cir[i].size(); j++) col[cir[i][j]] = 0;
  }
  for (int i = 0; i < e.size(); i++) {
    int u = e[i].first, v = e[i].second;
    if (id[u] != id[v]) {
      adj[id[u]].push_back(make_pair(id[v], i));
      adj[id[v]].push_back(make_pair(id[u], i));
    }
  }
  for (int i = 0; i < totcir; i++) sz[i] = (int)cir[i].size();
  int maxval = 0, maxnum = -1;
  for (int i = 0; i < totcir; i++)
    if (maxval < sz[i]) {
      maxval = sz[i];
      maxnum = i;
    }
  dfs(maxnum, -1);
  printf("%d\n", maxval);
  for (int i = 0; i < e.size(); i++) {
    int u = e[i].first, v = e[i].second;
    if (Map.find(make_pair(u, v)) != Map.end()) {
      printf("%d %d\n", u + 1, v + 1);
    } else {
      printf("%d %d\n", v + 1, u + 1);
    }
  }
  return 0;
}
