//#pragma GCC optimize("unroll-loops", "Ofast")
//#pragma GCC target("sse","sse2","avx","avx2")
#include <bits/stdc++.h>

#define int long long
#define F first
#define S second
using namespace std;

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, m, g;
    cin >> n >> m >> g;
    vector<pair<int, int>> e(m);
    int cnt = 0;
    for (int i = 0; i < m; ++i) {
        cin >> e[i].F >> e[i].S;
        if (e[i].F + 1 != e[i].S) {
            cnt++;
        }
    }
    cout << n - 1 << '\n';
    cout << 1;
    return 0;
}
//не забудь сохранять коды!!!

