#include <bits/stdc++.h>
using namespace std;
mt19937 gen(chrono::system_clock::now().time_since_epoch().count());
const int N = 4e5 + 10;
const long long MOD = 1e9 + 7;
const int rx[4] = {-1, 0, 1, 0};
const int ry[4] = {0, 1, 0, -1};
const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int hx[8] = {-2, -2, -1, 1, 2, 2, 1, -1};
const int hy[8] = {-1, 1, 2, 2, 1, -1, -2, -2};
const long double eps = 1e-7;
const double pi = acos(-1.0);
const int INF = 1e9;
vector<int> g[N], g2[N];
int timer = 1, tin[N], tin2[N], tout[N], fup[N];
bool used[N], used2[N], used3[N], used4[N];
unordered_map<long long, int> bridge, nom;
unordered_map<long long, pair<int, int> > nwbr;
int comp_kol, comp[N], comp_sz[N];
vector<pair<int, pair<int, int> > > ans;
void dfs_bridge(int v, int p = -1) {
  tin[v] = timer++;
  fup[v] = tin[v];
  used[v] = true;
  for (auto to : g[v]) {
    if (to == p) continue;
    if (used[to]) {
      fup[v] = min(fup[v], tin[to]);
    } else {
      dfs_bridge(to, v);
      fup[v] = min(fup[v], fup[to]);
      if (fup[to] > tin[v]) {
        bridge[v * 1000000ll + to] = true;
        bridge[to * 1000000ll + v] = true;
      }
    }
  }
}
void dfs_comp(int v, int p, int cmp) {
  comp[v] = cmp;
  used2[v] = true;
  for (auto to : g[v]) {
    if (bridge[v * 1000000ll + to]) {
      if (used2[to]) {
        g2[comp[v] - 1].push_back(comp[to] - 1);
        nwbr[{(comp[v] - 1) * 1000000ll + comp[to] - 1}] = {v, to};
      } else {
        comp_kol++;
        g2[comp[v] - 1].push_back(comp_kol - 1);
        nwbr[{(comp[v] - 1) * 1000000ll + comp_kol - 1}] = {v, to};
        dfs_comp(to, v, comp_kol);
      }
    } else if (!used2[to])
      dfs_comp(to, v, cmp);
  }
}
void dfs_cycl(int v, int p = -1) {
  used4[v] = true;
  tin[v] = timer++;
  for (auto to : g[v]) {
    if (bridge[v * 1000000ll + to] || to == p) continue;
    if (tin[to] < tin[v]) {
      ans.push_back({nom[v * 1000000ll + to], {v, to}});
    }
    if (used4[to]) continue;
    dfs_cycl(to, v);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    nom[x * 1000000ll + y] = i;
    nom[y * 1000000ll + x] = i;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs_bridge(0);
  comp_kol++;
  dfs_comp(0, -1, 1);
  for (int i = 0; i < n; i++) {
    comp[i]--;
    comp_sz[comp[i]]++;
    tin[i] = 0;
  }
  int mx = 0;
  for (int i = 0; i < comp_kol; i++) {
    if (comp_sz[i] > comp_sz[mx]) mx = i;
  }
  cout << comp_sz[mx] << '\n';
  used3[mx] = true;
  queue<int> q;
  q.push(mx);
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (auto to : g2[v]) {
      if (!used3[to]) {
        used3[to] = true;
        q.push(to);
        int x = nwbr[v * 1000000ll + to].first,
            y = nwbr[v * 1000000ll + to].second;
        ans.push_back({nom[x * 1000000ll + y], {y, x}});
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (!used4[i]) {
      timer = 1;
      dfs_cycl(i);
    }
  }
  sort(ans.begin(), ans.end());
  for (auto it : ans)
    cout << it.second.first + 1 << " " << it.second.second + 1 << '\n';
  return 0;
}
