#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, int> mp;
vector<int> vc[400050];
bool visit[400050];
int dis[400050], low[400050], t, pr[400050];
int mx, mxn, cnt;
int fx[400050], fy[400050];
void bridge(int u) {
  visit[u] = 1;
  dis[u] = low[u] = t;
  t++;
  for (int i = 0; i < vc[u].size(); i++) {
    int v = vc[u][i];
    if (v == pr[u]) continue;
    if (visit[v]) {
      low[u] = min(low[u], dis[v]);
    } else {
      pr[v] = u;
      bridge(v);
      low[u] = min(low[u], low[v]);
    }
    if (dis[u] < low[v]) {
      mp[{u, v}] = mp[{v, u}] = 1;
    }
  }
}
void dfs(int u) {
  cnt++;
  visit[u] = 1;
  for (int i = 0; i < vc[u].size(); i++) {
    int v = vc[u][i];
    if (mp[{u, v}] || mp[{v, u}]) continue;
    if (mp[{v, u}] != 2) mp[{u, v}] = 2;
    if (!visit[v]) {
      dfs(v);
    }
  }
}
void build(int u) {
  visit[u] = 1;
  for (int i = 0; i < vc[u].size(); i++) {
    int v = vc[u][i];
    if (visit[v]) continue;
    if (mp[{u, v}] == 1) {
      mp[{v, u}] = 2;
    }
    build(v);
  }
}
int main() {
  int n, m, u, v, i;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= m; i++) {
    scanf("%d %d", &u, &v);
    vc[u].push_back(v);
    vc[v].push_back(u);
    fx[i] = u, fy[i] = v;
  }
  t = 1;
  bridge(1);
  memset(visit, 0, sizeof visit);
  for (i = 1; i <= n; i++) {
    cnt = 0;
    if (!visit[i]) dfs(i);
    if (cnt > mx) {
      mx = cnt;
      mxn = i;
    }
  }
  memset(visit, 0, sizeof visit);
  build(mxn);
  printf("%d\n", mx);
  for (i = 1; i <= m; i++) {
    if (mp[{fx[i], fy[i]}] == 2)
      printf("%d %d\n", fx[i], fy[i]);
    else
      printf("%d %d\n", fy[i], fx[i]);
  }
}
