#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

vector<int> w;

void top(int v, vector<vector<pair<int, int>>> &gr, vector<int> &used, int i) {
    used[v] = i;
    for (auto x : gr[v]) {
        if (used[x.first] != i) {
            if (x.second % 2 == 0) {
                if (!(i & (1 << (x.second / 2)))) {
                    top(x.first, gr, used, i);
                }
            } else {
                if ((i & (1 << (x.second / 2)))) {
                    top(x.first, gr, used, i);
                }
            }
        }
    }
    w.push_back(v);
}

void dfs(int v, vector<vector<pair<int, int>>> &gr, vector<pair<int, int>> &comp, int i, int cnt) {
    comp[v].second = i;
    comp[v].first = cnt;
    for (auto x : gr[v]) {
        if (comp[x.first].second != i) {
            if (x.second % 2 == 0) {
                if ((i & (1 << (x.second / 2)))) {
                    dfs(x.first, gr, comp, i, cnt);
                }
            } else {
                if (!(i & (1 << (x.second / 2)))) {
                    dfs(x.first, gr, comp, i, cnt);
                }
            }
        }
    }
}


signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, m, g;
    cin >> n >> m >> g;
    cout << n - 1 << endl;
    cout << n << endl;
    exit(0);
    vector<vector<pair<int, int>>> gr(n);
    for (int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;
        u--;
        v--;
        gr[u].push_back({v, 2 * i});
        gr[v].push_back({u, 2 * i + 1});
    }
    vector<pair<int, int>> comp(n, {-1, -1});
    vector<pair<int, int>> f(n, {-1, -1});
    vector<pair<int, int>> answ(n, {-1, -1});
    vector<bool> answer((1 << m));
    vector<int> used(n, -1);
    for (int i = 0; i < (1 << m); i++) {
        int cnt = 0;
        for (int y = 0; y < n; y++) {
            if (used[y] != i) {
                top(y, gr, used, i);
            }
        }
        reverse(w.begin(), w.end());
        for (int y = 0; y < n; y++) {
            if (comp[w[y]].second != i) {
                dfs(w[y], gr, comp, i, cnt);
                cnt++;
            }
        }
        w.clear();
        int j = 0;
        for (int y = 0; y < n; y++) {
            if (answ[comp[y].first].second == i) {
                comp[y].first = answ[comp[y].first].first;
            } else {
                answ[comp[y].first].second = i;
                answ[comp[y].first].first = j;
                comp[y].first = j;
                j++;
            }
        }
        if (i == 0) {
            f = comp;
        }
        answer[i] = false;
        for (int y = 0; y < n; y++) {
            if (f[y].first != comp[y].first) {
                answer[i] = true;
                break;
            }
        }
    }
    answer[0] = true;
    vector<int> q(m + 1);
    for (int i = 0; i < (1 << m); i++) {
        int col = 0;
        for (int y = 0; y < m; y++) {
            if (i & (1 << y)) {
                col++;
                if (!answer[i - (1 << y)]) {
                    answer[i] = false;
                }
            }
        }
        if (answer[i]) {
            q[col]++;
        }
    }
    for (int i = m; i > -1; i--) {
        if (q[i] != 0) {
            cout << i << endl;
            cout << q[i] << endl;
            exit(0);
        }
    }
}
