#include<bits/stdc++.h>
using namespace std;
long long bincoef[1000],kojitr,maxdiff;
int poz,br,zadnji;
int bincf(int n,int k)
{
    int C[k+1];
    memset(C, 0, sizeof(C));
    C[0] = 1;
    for (int i = 1; i <= n; i++)
    {
        for (int j = min(i, k); j > 0; j--)
            C[j] = C[j] + C[j-1];
    }
    return C[k];
}
int main()
{
    scanf("%d",&kojitr);
    for(int i=3;i<=850;i++)
    {
        bincoef[i]=bincf(i,3);
    }
    /*for(int i=1;i<=850;i++)
    {
        if(bincoef[i]>kojitr)
        {
            kojitr-=bincoef[i-1];
            poz=i-1;
            break;
        }
        cout<<"0"<<" "<<i<<endl;
    }
    if(kojitr==0){return 0;}
    br=0;
    cout<<kojitr<<" "<<poz<<endl;
    //poz--;
    */
    poz=850;
    while(kojitr!=0)
    {
        for(int i=1;i<=850;i++)
        {
            //zadnji=i;
            if(bincoef[i]>=kojitr)
            {
               // cout<<bincoef[i]<<" "<<kojitr<<" "<<bincoef[i+1]<<" "<<bincoef[i-1]<<endl;
                if(bincoef[i]==kojitr){kojitr-=bincoef[i];}
                else{kojitr-=bincoef[i-1];}
                //poz=i;
                //cout<<bincoef[i]<<" "<<kojitr<<" "<<bincoef[i+1]<<" "<<bincoef[i-1]<<" "<<poz<< " " <<kojitr<<endl;
                break;
            }
            if(br==0){cout<<br<< " "<<i<<endl;continue;}
            if(br==2){cout<<br<<" "<<i<<endl;continue;}
            if(br==4){cout<<br*10000000<<" "<<(br+5)*(i+1000)<<endl;continue;}
            if(br==6){cout<<(-1)*br*10000000<<" "<<(br+5)*(i+1000)<<endl;continue;}
            if(br==8){cout<<br*(-1)<<" " <<i*(-1)<<endl;continue;}
            else{cout<<br*(-127425)<<" "<<(-1)*(br+5)*(i+10000)<<endl;continue;}
            zadnji=i;
        }
        //cout<<kojitr<<" "<<poz<<endl;
        br+=2;
    }
    cout<<(br-2)*(-127425)<<" "<<(-1)*(br+5)*(zadnji+10001)<<endl;
    return 0;
}