#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ld = long double;
template <typename T>
ll sz(T& a) {
    return (ll)a.size();
}





int main() {
//    cout.setf(ios::fixed); cout.precision(15);
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#ifdef manix888
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif


    int n, m, gol;
    cin >> n >> m >> gol;
    vector<vector<int>> defg(n);
    vector<pii> edges;
    for (int i=0; i<m; i++) {
        int a, b; cin >> a >> b; a--; b--;
        defg[a].push_back(b);
        edges.push_back({a, b});
    }

    cout << n-1 << '\n' << 1;


    return 0;
}