#include <bits/stdc++.h>
using namespace std;
const int max_n = 400555, log_n = 32, max_m = 111, mod = 1000000007,
          inf = 1111111111;
int n, m, used[max_n], tin[max_n], fout[max_n], privet5, vertex[max_n], k,
    used1[max_n], ptr[max_n], used_ind[max_n];
vector<pair<int, int> > v[max_n];
vector<pair<pair<int, int>, pair<int, int> > > v1[max_n];
vector<pair<int, int> > bridge[max_n];
pair<int, int> res[max_n];
void dfs(int x, int p) {
  tin[x] = fout[x] = privet5++;
  used[x] = 1;
  int p1;
  for (int i = 0; i < v[x].size(); ++i) {
    int to = v[x][i].first;
    if (to == p) {
      p1 = i;
      continue;
    }
    if (used[to])
      fout[x] = min(fout[x], tin[to]);
    else {
      dfs(to, x);
      fout[x] = min(fout[x], fout[to]);
      if (fout[to] > tin[x]) {
        bridge[x].push_back(v[x][i]);
        used_ind[v[x][i].second] = 1;
      }
    }
  }
  if (fout[x] > tin[p]) {
    bridge[x].push_back(v[x][p1]);
  }
}
void dfs1(int x, int k) {
  if (!used[x]) {
    ptr[x] = k;
    vertex[k]++;
    for (int i = 0; i < bridge[x].size(); ++i) {
      v1[k].push_back(
          make_pair(bridge[x][i], make_pair(bridge[x][i].first, x)));
    }
  }
  used[x] = 1;
  while (v[x].size()) {
    pair<int, int> g = v[x].back();
    v[x].pop_back();
    int to = g.first;
    if (used_ind[g.second]) {
      continue;
    }
    used_ind[g.second] = 1;
    res[g.second] = make_pair(x, to);
    dfs1(to, k);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int g, h;
    scanf("%d%d", &g, &h);
    g--;
    h--;
    v[g].push_back(make_pair(h, i));
    v[h].push_back(make_pair(g, i));
  }
  dfs(0, -1);
  for (int i = 0; i < n; ++i) used[i] = 0;
  for (int i = 0; i < n; ++i)
    if (!used[i]) {
      dfs1(i, k++);
    }
  for (int i = 0; i < k; ++i) {
    for (int q = 0; q < v1[i].size(); ++q) {
      v1[i][q].first.first = ptr[v1[i][q].first.first];
    }
  }
  set<pair<int, int> > s;
  for (int i = 0; i < k; ++i) s.insert(make_pair(vertex[i], i));
  int ans = inf;
  while (s.size()) {
    pair<int, int> g = *s.rbegin();
    s.erase(g);
    used1[g.second] = 1;
    ans = min(ans, g.first);
    for (int i = 0; i < v1[g.second].size(); ++i) {
      int to = v1[g.second][i].first.first;
      if (!used1[to]) {
        int ind = v1[g.second][i].first.second;
        res[ind] = v1[g.second][i].second;
        s.erase(make_pair(vertex[to], to));
        vertex[to] += g.first;
        s.insert(make_pair(vertex[to], to));
      }
    }
  }
  cout << ans << "\n";
  for (int i = 0; i < m; ++i)
    printf("%d %d\n", res[i].first + 1, res[i].second + 1);
}
