#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int t = 0;
    int sz = 1;
    if(n == 1) {
        cout << "1 1" << endl;
        return 0;
    }
    while(t <= n) {
        t += sz;
        if(t == n - 1) {
            cout << "1 0" << endl;
            return 0;
        }
        if(t == n) {
            cout << "0 1" << endl;
            return 0;
        }
        sz++;
    }
    cout << "0 0" << endl;
    return 0;
}

