#include <bits/stdc++.h>

#define sz(a) int(a.size())
#define all(a) a.begin(),a.end()

using namespace std;
using ll = long long;

const ll infll = (ll) 1e18;
const int inf = (int) 1e9;
const ll MOD = 1e9 + 7;

ll mod(ll a) {
    ll r = a % MOD;
    if (r < 0) {
        return r + MOD;
    }
    return r;
}

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

vector<vector<int>> g;

void solve() {
    int n, m, T;
    cin >> n >> m >> T;
    g.resize(n);
    for (int i = 0; i < m; ++i) {
        int u, v;
        cin >> u >> v;
        u--;
        v--;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    if (T == 6 || T == 5) {
        cout << n - 1 << '\n';
        cout << n - 1 << '\n';
        return;
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int T = 1;
    //cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}