#include <bits/stdc++.h>
using namespace std;
const int N = 400005;
vector<int> adj[N];
vector<int> st;
int cTime = 1;
int in[N];
int low[N];
vector<vector<int>> comps;
map<array<int, 2>, int> edgeToI;
array<int, 2> res[N];
int edgeToIndex(int a, int b) { return edgeToI[{min(a, b), max(a, b)}]; }
void addRes(int a, int b) { res[edgeToIndex(a, b)] = {a, b}; }
void dfs(int node, int par) {
  in[node] = cTime++;
  low[node] = in[node];
  st.push_back(node);
  for (int next : adj[node]) {
    if (next == par) continue;
    if (in[next]) {
      low[node] = min(low[next], low[node]);
    } else {
      dfs(next, node);
      low[node] = min(low[node], low[next]);
    }
  }
  if (in[node] == low[node]) {
    vector<int> cur;
    while (true) {
      int last = st.back();
      st.pop_back();
      cur.push_back(last);
      if (last == node) break;
    }
    comps.push_back(cur);
  }
}
bool onCircle[N];
bool vis[N];
void getEdges(int node) {
  vis[node] = true;
  for (int next : adj[node]) {
    if (res[edgeToIndex(node, next)][0] != 0) continue;
    addRes(next, node);
    if (!vis[next]) getEdges(next);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
    edgeToI[{min(a, b), max(a, b)}] = i;
  }
  dfs(1, -1);
  vector<int> best;
  for (auto comp : comps) {
    if (comp.size() > best.size()) best = comp;
  }
  for (int i : best) onCircle[i] = true;
  vector<array<int, 2>> edges;
  cout << best.size() << "\n";
  if (best.size() != 1) {
  }
  getEdges(best[0]);
  for (int i = 0; i < m; i++) {
    cout << res[i][0] << " " << res[i][1] << "\n";
  }
}
