#include <bits/stdc++.h>
#pragma GCC optimize("Ofast", "inline")
#include <ext/pb_ds/assoc_container.hpp>

#define pii pair <int, int>
#define fi first
#define se second
#define pb push_back
#define int int64_t

using namespace std;
using namespace __gnu_pbds;

typedef tree <int, null_type, less_equal <int>, rb_tree_tag, tree_order_statistics_node_update> oset;

mt19937 gen(time(0));

const int N = 2e3 + 50;

int fup[N], tin[N], timer = 1;
set <pii> ban;
set <int> g[N];

vector <int> order;
bool used[N];

void topsort (int v) {
    used[v] = 1;
    for (auto to : g[v]) {
        if (!used[to]) {
            topsort(to);
        }
    }
    order.pb(v);
}

vector <int> gr[N];
int cl[N], color = 1;

void DFS (int v) {
    cl[v] = color;
    for (auto to : gr[v]) {
        if (!cl[to]) {
            DFS(to);
        }
    }
}

int32_t main () {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif // LOCAL
    int n, m, group;
    cin >> n >> m >> group;
    vector <pii> edges;
    for (int i = 0; i < m; ++i) {
        int x, y;
        cin >> x >> y;
        x--;
        y--;
        g[x].insert(y);
        gr[y].pb(x);
        edges.pb({x, y});
    }
    cout << m << ' ' << 1;
}
