#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = 1LL * INF * INF;
const int MAX = 400400;
struct edge {
  int a, b;
  bool isM;
  int tp;
};
int n, m;
bool used[MAX];
vector<edge> E;
vector<int> g[MAX];
int a, b;
void add_edge(int a, int b) {
  edge e;
  e.isM = 0;
  e.tp = 0;
  e.a = a;
  e.b = b;
  g[a].push_back(E.size());
  E.push_back(e);
  swap(e.a, e.b);
  g[b].push_back(E.size());
  E.push_back(e);
}
int timer, tin[MAX], fup[MAX];
int clr;
void dfs1(int v, int p = -1) {
  used[v] = true;
  tin[v] = fup[v] = timer++;
  for (size_t i = 0; i < g[v].size(); ++i) {
    int to = E[g[v][i]].b;
    if (to == p) continue;
    if (used[to])
      fup[v] = min(fup[v], tin[to]);
    else {
      dfs1(to, v);
      fup[v] = min(fup[v], fup[to]);
      if (fup[to] > tin[v]) {
        E[g[v][i]].isM = E[g[v][i] ^ 1].isM = 1;
      }
    }
  }
}
int SZ = 0;
void dfs2(int v, int p, int clr) {
  used[v] = true;
  SZ++;
  for (int i = (0); i < (g[v].size()); ++i)
    if (E[g[v][i]].b != p && !E[g[v][i]].isM) {
      if (used[E[g[v][i]].b])
        E[g[v][i] ^ 1].tp = 1, E[g[v][i]].tp = 0;
      else
        E[g[v][i]].tp = 1;
      if (!used[E[g[v][i]].b]) dfs2(E[g[v][i]].b, v, clr);
    }
}
void dfs3(int v) {
  used[v] = true;
  SZ++;
  for (int i = (0); i < (g[v].size()); ++i) {
    if (!used[E[g[v][i]].b]) {
      if (E[g[v][i]].isM) E[g[v][i] ^ 1].tp = 1;
      dfs3(E[g[v][i]].b);
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = (0); i < (m); ++i) {
    scanf("%d%d", &a, &b);
    add_edge(a - 1, b - 1);
  }
  dfs1(0);
  pair<int, int> MX = make_pair(0, 0);
  memset(used, 0, sizeof(used));
  for (int i = (0); i < (n); ++i) {
    if (used[i]) continue;
    clr++;
    SZ = 0;
    dfs2(i, -1, clr);
    MX = max(MX, make_pair(SZ, i));
  }
  memset(used, 0, sizeof(used));
  cout << endl;
  dfs3(MX.second);
  cout << MX.first << endl;
  for (int i = (0); i < (E.size()); ++i)
    if (E[i].tp) cout << E[i].a + 1 << " " << E[i].b + 1 << "\n";
  return 0;
}
