#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4e5 + 10;
int n, m;
vector<pair<int, int> > graf[MAXN], edge;
bool bridge[MAXN];
int low[MAXN];
int cc = 1, sz[MAXN], comp[MAXN], disc[MAXN];
int rev[MAXN];
int timer = 1;
int find_bridge(int node, int dad) {
  disc[node] = low[node] = timer++;
  for (auto y : graf[node]) {
    int kamo = y.first;
    int ind = y.second;
    if (kamo == dad) continue;
    if (disc[kamo])
      low[node] = min(low[node], low[kamo]);
    else {
      int t = find_bridge(kamo, node);
      low[node] = min(low[node], t);
      if (low[kamo] > disc[node]) bridge[ind] = true;
    }
  }
  return low[node];
}
void compaj(int node) {
  sz[cc]++;
  comp[node] = cc;
  for (auto y : graf[node]) {
    int kamo = y.first;
    int ind = y.second;
    if (comp[kamo] != 0) continue;
    if (bridge[ind]) continue;
    compaj(kamo);
  }
}
bool bio[MAXN];
void kreni(int node, int dad) {
  bio[node] = true;
  for (auto y : graf[node]) {
    int kamo = y.first;
    int ind = y.second;
    if (rev[ind] != 0 || kamo == dad) continue;
    if (bridge[ind] && edge[ind].first == node)
      rev[ind] = -1;
    else if (!bridge[ind] && edge[ind].second == node)
      rev[ind] = -1;
    else
      rev[ind] = 1;
    if (!bio[kamo]) kreni(kamo, node);
  }
}
int maxi_ind;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    graf[a].push_back(make_pair(b, i));
    graf[b].push_back(make_pair(a, i));
    edge.push_back(make_pair(a, b));
  }
  find_bridge(1, 0);
  for (int i = 1; i <= n; i++) {
    if (comp[i] == 0) {
      compaj(i);
      if (sz[cc] > sz[maxi_ind]) maxi_ind = cc;
      cc++;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (comp[i] == maxi_ind) {
      kreni(i, 0);
      break;
    }
  }
  cout << sz[maxi_ind] << endl;
  for (int i = 0; i < m; i++) {
    if (rev[i] == -1) swap(edge[i].first, edge[i].second);
    cout << edge[i].first << ' ' << edge[i].second << endl;
  }
  return 0;
}
