#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <queue>
#define all(v) v.begin(), v.end()
#define fi first
#define se second

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<long long, long long> pii;

const ll SZ = 2000;

vector<ll> g[SZ];
vector<ll> g2[SZ];
ll used[SZ];
ll c[SZ];
vector<ll> path;
ll cnt[SZ][SZ];

void dfs(ll v) {
	used[v] = 1;
	for (auto u : g[v]) {
		if (!used[u]) dfs(u);
	}
	path.push_back(v);
}

void dfs2(ll v, ll co) {
	c[v] = co;
	for (auto u : g2[v]) {
		if (!c[u]) dfs2(u, co);
	}
}

void solve() {
	ll n, m, h, v, u;
	cin >> n >> m >> h;
	vector<pii> edges;
	for (ll i = 0; i < m; i++) {
		cin >> v >> u;
		g[--v].push_back(--u);
		g2[u].push_back(v);
		edges.push_back({ v, u });
	}
	cout << n << '\n';
	cout << m << '\n';
}

int main() {
	ll t = 1;
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	cin >> t;
#else
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
#endif
	while (t--) solve();
}