#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <ctime>
#include <climits>
#include <iomanip>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <string>
#include <queue>
#include <random>

#define int long long

#pragma GCC optimize("03,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")

using ll = long long;
using ld = long double;
using namespace std;

const ll INF = 1e18;


vector<vector<int>> g;
vector<vector<int>> g1;
vector<int> used;
vector<int> col;
vector<int> ts;
int cur = 0;

void dfs(int v) {
	used[v] = 1;
	for (auto& to : g[v]) {
		if (!used[to]) {
			dfs(to);
		}
	}
	ts.push_back(v);
}


void dfs1(int v) {
	used[v] = 1;
	col[v] = cur;
	for (auto& to : g1[v]) {
		if (!used[to]) {
			dfs1(to);
		}
	}
}

void solve() {
	int n, m, num;
	cin >> n >> m >> num;
	g.resize(n);
	used.resize(n);
	col.resize(n);
	g1.resize(n);
	vector<pair<int, int>> rebs;
	for (int i = 0; i < m; i++) {
		int v, u;
		cin >> v >> u;
		v--;
		u--;
		rebs.push_back({ v, u });
		g[v].push_back(u);
		g1[u].push_back(v);
	}
	cout << m - 1 << "\n" << 1;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	solve();
	return 0;
}