#include <bits/stdc++.h>

//#pragma GCC optimize("Ofast")

#define int long long

using namespace std;

const int mod = 1e9 + 7;
const int maxn = 2e5 + 1;
const int inf = 4e18;

void solve() {
    int n, m, gg; cin >> n >> m >> gg;
    vector<vector<int>> g(n);
    for (int i = 0; i < n; i++) {
        int v, u; cin >> v >> u;
        g[v].push_back(u);
    }
    cout << n - 1 << ' ' << n - 1 << '\n';

}

signed main() {
#ifdef LOCAL
    freopen("../input.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int tt = 1;
//    cin >> tt;
    while (tt--) {
        solve();
    }
    return 0;
}
