#include <bits/stdc++.h>
using namespace std;
int root;
vector<pair<int, int> > adj[400005];
pair<int, int> Edge[400005];
stack<int> s;
bool instack[400005];
int num[400005];
int lowlink[400005];
int dfsnum = 1;
int largest = 0;
void dfs(int u = 1, int par = 0) {
  num[u] = lowlink[u] = dfsnum++;
  s.push(u);
  instack[u] = 1;
  for (int i = 0; i < (int)adj[u].size(); i++) {
    pair<int, int> x = adj[u][i];
    int v = x.first, id = x.second;
    if (v == par) continue;
    Edge[id] = pair<int, int>(v, u);
    if (num[v] == 0) {
      dfs(v, u);
      lowlink[u] = min(lowlink[v], lowlink[u]);
      Edge[id] = pair<int, int>(v, u);
    } else if (instack[v]) {
      lowlink[u] = min(lowlink[u], num[v]);
      Edge[id] = pair<int, int>(u, v);
    }
  }
  if (num[u] == lowlink[u]) {
    int cnt = 0;
    while (1) {
      int x = s.top();
      s.pop();
      instack[x] = 0;
      cnt++;
      if (x == u) break;
    }
    if (cnt > largest) {
      largest = cnt;
      root = u;
    }
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    adj[u].push_back(pair<int, int>(v, i));
    adj[v].push_back(pair<int, int>(u, i));
    Edge[i] = pair<int, int>(u, v);
  }
  dfs();
  memset(num, 0, sizeof num);
  dfs(root);
  printf("%d\n", largest);
  for (int i = 0; i < m; i++) printf("%d %d\n", Edge[i].first, Edge[i].second);
  return 0;
}
