#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
// typedef tree<int,null_type,less<>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
#define int long long
const int N=2e5+10;
int n,m;
vector<int>g[N],gr[N];

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int i,j,t;
    cin >> n >> m >> t;
    for(i=0;i<m;i++){
        int x,y;
        cin >> x >> y;
        g[x].push_back(y);
    }
    cout << n-1 << " " << n;
    return 0;
}