#include <bits/stdc++.h>

using namespace std;

#define int long long
#define ins insert
#define f first 
#define s second 
#define pb push_back 
#define emp emplace_back 
#define pf push_front 
#define popf pop_front 
#define popb pop_back 
const int INF = 1e18;

vector < int > psum,a;
int T;
int sum (int l,int r) {
    return psum[r + 1] - psum[l];
}

int calc_ans_R (int i,int k) {
    if (i != k && T < sum(i + 1,k)) {
        return -INF;
    }
    int s = 0;
    if (i != k) s = sum (i + 1,k);
    return (T - s) / a[i] + k - i;
}

int calc_ans_L (int k,int i) {
    if (i != k && T < sum(k,i - 1)) {
        return -INF;
    }
    int s = 0;
    if (i != k) s = sum(k,i - 1);
    return (T - s) / a[i] + i - k;
}

int calc_ans (int k,int i) {
    if (i < k) {
        return calc_ans_R(i,k);
    }
    return calc_ans_L(k,i);
}
void solve () {
    int n,m,g;
    cin >> n >> m >> g;
    if (g != 5) {
        assert(false);
    }
    if (n == m) {
        cout << n - 1 << " " << 1 << endl;
        return ;
    } 
    cout << 0 << " " << 1 << endl;



}
signed main () {
#ifdef LOCAL 
    freopen ("input.txt","r",stdin);
#endif
    solve();
    return 0;
}