//#define _GLIBCXX_DEBUG
//#define _GLIBCXX_DEBUG_PEDANTIC

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define OPTIMIZETHISSHIT ios::sync_with_stdio(false); cin.tie(nullptr);
#define int long long
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fi first
#define se second

using namespace std;
using namespace __gnu_pbds;

template<typename T>
using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

mt19937_64 rng(0);

int rand(int l, int r) {
    return uniform_int_distribution<int>(l, r)(rng);
}

vector<vector<int>> g, gt;
vector<int> topsort;

void solve() {
    int n, m, group;
    cin >> n >> m >> group;
    g.resize(n + 1);
    gt.resize(n + 1);
    for (int i = 0; i < m; i++) {
        int v, u;
        cin >> v >> u;
        g[v].pb(u);
        gt[u].pb(v);
    }
    cout << n << ' ' << n << endl;

}

signed main() {
    OPTIMIZETHISSHIT

    solve();
}