#include <iostream>
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

#define int long long
#define st first
#define nd second

typedef tree<int, null_type, std::less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int ans = 0;
vector<int> used;
vector<vector<int>> G;

mt19937_64 rnd(std::chrono::steady_clock::now().time_since_epoch().count());

signed main()
{
    int n, m, g;
    cin >> n >> m >> g;

    G.resize(n);
    for (int i = 0; i < m; ++i)
    {
        int v, u; cin >> v >> u; --v; --u;
        G[u].push_back(v);
        G[v].push_back(u);
    }

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

    return 0;
}
