#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 4e5 + 10;
vector<pair<long long, long long> > tree[MAXN];
vector<pair<long long, long long> > vertex[MAXN];
pair<long long, long long> res[MAXN];
long long c[MAXN];
long long p[MAXN];
long long dp[MAXN];
long long height[MAXN];
long long parent[MAXN];
bool edge[MAXN];
bool check[MAXN];
void edge_cut(long long v, long long h) {
  check[v] = true;
  height[v] = h;
  dp[v] = v;
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (check[vertex[v][i].first] && vertex[v][i].first != parent[v]) {
      if (height[vertex[v][i].first] < height[dp[v]]) {
        dp[v] = vertex[v][i].first;
      }
    }
  }
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first]) {
      parent[vertex[v][i].first] = v;
      edge_cut(vertex[v][i].first, h + 1);
      if (height[dp[vertex[v][i].first]] > height[v]) {
        edge[vertex[v][i].second] = true;
      }
      if (height[dp[vertex[v][i].first]] < height[dp[v]]) {
        dp[v] = dp[vertex[v][i].first];
      }
    }
  }
}
void dfs(long long v, long long id) {
  check[v] = true;
  c[v] = id;
  p[id]++;
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first] && !edge[vertex[v][i].second]) {
      dfs(vertex[v][i].first, id);
    }
  }
}
void o_dfs(long long v) {
  check[v] = true;
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first]) {
      if (c[v] != c[vertex[v][i].first]) {
        res[vertex[v][i].second] = make_pair(vertex[v][i].first, v);
      }
      o_dfs(vertex[v][i].first);
    }
  }
}
void i_dfs(long long v) {
  check[v] = true;
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (check[vertex[v][i].first] && parent[v] != vertex[v][i].first) {
      res[vertex[v][i].second] = make_pair(v, vertex[v][i].first);
    }
  }
  for (long long i = 0; i < vertex[v].size(); i++) {
    if (!check[vertex[v][i].first] && !edge[vertex[v][i].second]) {
      res[vertex[v][i].second] = make_pair(v, vertex[v][i].first);
      parent[vertex[v][i].first] = v;
      i_dfs(vertex[v][i].first);
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, id = 1;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long v, u;
    cin >> v >> u;
    vertex[v].push_back(make_pair(u, id));
    vertex[u].push_back(make_pair(v, id++));
  }
  edge_cut(1, 0);
  fill(check, check + MAXN, false);
  fill(parent, parent + MAXN, 0);
  for (long long i = 1; i <= n; i++) {
    if (!check[i]) {
      i_dfs(i);
    }
  }
  fill(check, check + MAXN, false);
  id = 1;
  for (long long i = 1; i <= n; i++) {
    if (!check[i]) {
      dfs(i, id++);
    }
  }
  fill(check, check + MAXN, false);
  long long t = 0, e = 0;
  for (long long i = 1; i <= n; i++) {
    if (t < p[c[i]]) {
      t = p[c[i]];
      e = i;
    }
  }
  fill(check, check + MAXN, false);
  o_dfs(e);
  cout << t << endl;
  for (long long i = 1; i <= m; i++) {
    cout << res[i].first << " " << res[i].second << endl;
  }
}
