#include <bits/stdc++.h>

using ll = long long;
using namespace std;
const int INF = 1e9, MOD = 1e9 + 7;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

void solve() {
    int n, m, g;
    cin >> n >> m >> g;
    vector<int> cnt(n, 0);
    for (int i = 0; i < m; ++i) {
        int u, v;
        cin >> u >> v;
        cnt[v - 1]++;
    }
    ll ans = 0;
    for (int i = 0; i < n; ++i) {
        ans += cnt[i] > 1;
    }
    cout << n << "\n2\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
}
