#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <algorithm>
#include <iomanip>

using namespace std;
using ll = long long;
using ld = long double;
#define all(x) x.begin(),x.end()
//#pragma GCC optimize("Ofast")
const ll INF = 1e9 + 7;
template<typename T>
void input(vector<T>& arr, size_t size) {
	arr.resize(size);
	for (T& i : arr) {
		cin >> i;
	}
}
template<typename T>
void print(vector<T>& arr) {
	for (T& i : arr) {
		cout << i << ' ';
	}
	cout << '\n';
}

vector<vector<int>> g;

void solve() {
	int n, m, gp;
	cin >> n >> m >> gp;
	g.resize(n);
	for (size_t i = 0; i < m; i++)
	{
		int a, b;
		cin >> a >> b;
		--a; --b;
		g[a].push_back(b);
	}
	cout << m - n + 1 << " 1";
}

int main() {
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
#endif // _DEBUG
	ios::sync_with_stdio(0);
	cin.tie(0);
	int tt = 1;
#ifdef _DEBUG
	cin >> tt;
#endif // _DEBUG
	while (tt--)
	{
		solve();
#ifdef _DEBUG
		cout << "\n================\n";
#endif // _DEBUG
	}
}