#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<pair<int, int> > edge, state;
vector<vector<pair<int, int> > > graph;
vector<int> low, vis, parent, scc;
int t = 1;
vector<int> bri;
void dfs(int start) {
  vis[start] = low[start] = t;
  t++;
  for (auto e : graph[start]) {
    int i = e.first;
    if (vis[i] == 0) {
      parent[i] = start;
      dfs(i);
      if (low[i] > vis[start]) {
        bri[e.second] = 1;
      }
      low[start] = min(low[start], low[i]);
    } else if (i != parent[start])
      low[start] = min(low[start], low[i]);
  }
}
void DFS(int start, int num) {
  scc[start] = num;
  for (auto e : graph[start]) {
    int i = e.first;
    int id = e.second;
    if (bri[id] == 0) {
      if (scc[i] == -1) {
        DFS(i, num);
      }
    }
  }
}
int mx = 0, id;
void solve(int start) {
  for (auto p : graph[start]) {
    int e = p.second;
    int i = p.first;
    if (state[e] == pair<int, int>(-1, -1)) {
      if (bri[e] != 1) {
        state[e] = pair<int, int>(start, i);
      } else
        state[e] = pair<int, int>(i, start);
      solve(i);
    }
  }
}
int main() {
  int i, x, y;
  scanf("%d %d", &n, &m);
  graph.assign(n + 1, vector<pair<int, int> >());
  for (i = 0; i < m; i++) {
    scanf("%d %d", &x, &y);
    graph[x].push_back(pair<int, int>(y, i));
    graph[y].push_back(pair<int, int>(x, i));
    edge.push_back(pair<int, int>(x, y));
  }
  bri.assign(m, 0);
  low.assign(n + 1, 0);
  vis.assign(n + 1, 0);
  parent.assign(n + 1, 0);
  dfs(1);
  scc.assign(n + 1, -1);
  int num = 0;
  for (i = 1; i <= n; i++) {
    if (scc[i] == -1) {
      DFS(i, num);
      num++;
    }
  }
  vector<int> cnt(n, 0);
  for (i = 1; i <= n; i++) cnt[scc[i]]++;
  for (i = 0; i < n; i++) {
    if (cnt[i] > mx) {
      mx = cnt[i];
      id = i;
    }
  }
  int s;
  printf("%d\n", mx);
  for (i = 1; i <= n; i++) {
    if (scc[i] == id) {
      s = i;
      break;
    }
  }
  state.assign(m, pair<int, int>(-1, -1));
  solve(s);
  for (i = 0; i < m; i++) {
    printf("%d %d\n", state[i].first, state[i].second);
  }
}
