#include <bits/stdc++.h>

#define int long long
constexpr int INF = 4e18;

std::vector<std::vector<int>> g;

void solve()
{
    int n, m, group;
    std::cin >> n >> m >> group;
    g.assign(n, std::vector<int>());
    for (int i = 0; i < m; ++i) {
        int u, v;
        std::cin >> u >> v;
        u--, v--;
        g[u].push_back(v);
    }
    std::cout << m - n + 1 << ' ' << 1 << '\n';
}

signed main()
{
    int t = 1;
#ifdef LOCAL
    freopen("stream/ina.txt", "r", stdin);
    freopen("stream/outa.txt", "w", stdout);
    std::cin >> t;
#else
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
#endif
    for (int i_t = 1; i_t <= t; ++i_t) {
#ifdef LOCAL
    std::cout << "Test case " << i_t << '\n';
#endif
        solve();
    }
    std::cout.flush();
    return 0;
}