#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#pragma GCC target("avx2")
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define yes() cout << "YES\n"
#define no() cout << "NO\n"
using ll = long long;
using ld = long double;
using namespace std;
using namespace __gnu_pbds;

template<typename K>
using oset = tree<K, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;

struct segTree {
    vector<int> t;
    int n;

    void build(int v, int l, int r, vector<int>& a) {
        if (r - l == 1) {
            t[v] = a[l];
            return;
        }

        int m = (l + r) / 2;

        build(2 * v, l, m, a);
        build(2 * v + 1, m, r, a);

        t[v] = t[2 * v] + t[2 * v + 1];
    }

    segTree(vector<int>& a) {
        n = a.size();
        t.resize(4 * n);

        build(1, 0, n, a);
    }

    int get(int v, int l, int r, int ql, int qr) {
        if (l >= qr || r <= ql) {
            return 0;
        }

        if (ql <= l && r <= qr) {
            return t[v];
        }

        int m = (l + r) / 2;

        return get(2 * v, l, m, ql, qr) + get(2 * v + 1, m, r, ql, qr);
    }

    int get(int ql, int qr) {
        return get(1, 0, n, ql, qr);
    }

    void upd(int v, int l, int r, int idx, int val) {
        if (r - l == 1) {
            t[v] = val;
            return;
        }

        int m = (l + r) / 2;

        if (idx < m) {
            upd(2 * v, l, m, idx, val);
        } else {
            upd(2 * v + 1, m, r, idx, val);
        }

        t[v] = t[2 * v] + t[2 * v + 1];
    }

    void upd(int idx, int val) {
        upd(1, 0, n, idx, val);
    }
};

void solve() {
    int n, m, group;
    cin >> n >> m >> group;

    cout << "0 1\n";
    return;
    vector<vector<int>> g(n);
    vector<pair<int, int>> g1;
    for (int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;

        u--;
        v--;

        g[u].push_back(v);
        g1.push_back({u, v});
    }

    vector<vector<int>> d(n, vector<int> (n));
    for (int i = 0; i < n; i++) {
        vector<int> used(n, 0);
        used[i] = 1;
        queue<int> q;
        q.push(i);

        while (q.size()) {
            int v = q.front();
            q.pop();

            for (int& u : g[v]) {
                if (!used[u]) {
                    used[u] = 1;
                    q.push(u);
                }
            }
        }

        for (int j = 0; j < n; j++) {
            if (used[j]) {
                d[i][j] = 1;
            }
        }
    }

    int mx = 0;
    int cnt = 0;

    for (int mask = 0; mask < (1 << m); mask++) {
        int ans = 0;

        for (int i = 0; i < m; i++) {
            if (mask >> i & 1) ans++;
        }

        int y = 1;

        for (int submask = mask; submask; submask = (submask - 1) & mask) {
            if (!submask) continue;
            if (!y) break;

            vector<vector<int>> g2(n);
            for (int i = 0; i < m; i++) {
                if (mask >> i & 1) {
                    if (submask >> i & 1) {
                        g2[g1[i].second].push_back(g1[i].first);
                    } else {
                        g2[g1[i].first].push_back(g1[i].second);
                    }
                } else {
                    g2[g1[i].first].push_back(g1[i].second);
                }
            }

            vector<vector<int>> d1(n, vector<int> (n));
            for (int i = 0; i < n; i++) {
                vector<int> used(n, 0);
                used[i] = 1;
                queue<int> q;
                q.push(i);

                while (q.size()) {
                    int v = q.front();
                    q.pop();

                    for (int& u : g2[v]) {
                        if (!used[u]) {
                            used[u] = 1;
                            q.push(u);
                        }
                    }
                }

                for (int j = 0; j < n; j++) {
                    if (used[j]) {
                        d1[i][j] = 1;
                    }
                }
            }

            int yes = 0;
            for (int i = 0; i < n; i++) {
                for (int j = i + 1; j < n; j++) {
                    if ((d[i][j] && d[j][i]) != (d1[i][j] && d1[j][i])) {
                        yes = 1;
                    }
                }
            }
            y &= yes;
        }

        if (y) {
            if (ans > mx) {
                mx = ans;
                cnt = 1;
            } else if (ans == mx) {
                cnt++;
            }
        }
    }

    cout << mx << " " << cnt << "\n";
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t = 1;
//    cin >> t;

    while (t--) {
        solve();
    }
}