#include <bits/stdc++.h>

#define int ll
#define vec vector
#define ll long long
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define pb push_back
#define pii pair < int, int >

using namespace std;

const int N = 2000;
const int mod = 1e9 + 7;
const int oo = 2e9;
const ll OO = 1e18;

template <typename T>
bool umx (T &a, T b) {return (a < b ? (a = b, 1) : 0); }

int bpow (int a, int b) {
    if (b == 0)
        return 1;
    if (b % 2)
        return a * bpow(a, b - 1);
    int t = bpow(a, b / 2);
    return t * t;
}

void update (int v, int l, int r, int ql, int qr, int x) {
    if (l > qr || r < ql)
        return;
    if (l >= ql && r <= qr) {

        return;
    }
    int m = l + r >> 1;
    update(v << 1, l, m, ql, qr, x);
    update(v << 1 | 1, m + 1, r, ql, qr, x);
//    seg[v] =
}
vec < int > g[N];

signed main () {
    int n, m, g;
    cin >> n >> m >> g;
    for (int i = 0, u, v; i < n; ++i) {
        cin >> u >> v;
        --u, --v;
    }
    cout << m - (n - 1) << " " << -1;
}
