stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



#define ll long long

#define fi first

#define se second

#define inf 1e15



#define N 300005



vector<int>row[N];



multiset<int>Noofbombsincolumnsset;



int bombsineachcolumn[N];



void upd(int pos,int delta){

    

    Noofbombsincolumnsset.erase(Noofbombsincolumnsset.find(bombsineachcolumn[pos]));

    

    bombsineachcolumn[pos]+=delta;

    

    Noofbombsincolumnsset.insert(bombsineachcolumn[pos]);

    

}

int main() {

    

    ios_base::sync_with_stdio(false);

    cin.tie(NULL); cout.tie(NULL);

    

	int t=1;

//	cin>>t;

	while(t--){

	    

	    int n,m,k;

	    cin>>n>>m>>k;

	    

	    for(int i=0;i<m;i++){

	        Noofbombsincolumnsset.insert(0);

	        bombsineachcolumn[i]=0;

	    }

	    for(int i=0;i<k;i++){

	        int x,y;

	        cin>>x>>y;

	        x--;y--;

	        row[x].push_back(y);

	        //add

	        upd(y,1);

	    }

	    int ans=0;

	    

	    for(int i=0;i<n;i++){

	        

	        int cnt=row[i].size();

	        

	        for(auto y:row[i]){

	            //remove

	            upd(y,-1);

	        }

	        

	        cnt+= *Noofbombsincolumnsset.rbegin();

	        

	        ans=max(ans,cnt);

	        

	        for(auto y:row[i]){

	            //add

	            upd(y,1);

	        }

	        

	    }

	    

	    cout<<ans<<"\n";

	    

	    

	}

	return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



#define ll long long

#define fi first

#define se second

#define inf 1e15



#define N 300005



int row[N];

int col[N];



vector<int>rowv,colv;



set<pair<int,int>>bomb;



int main() {

    

    ios_base::sync_with_stdio(false);

    cin.tie(NULL); cout.tie(NULL);

    

	int t=1;

	//cin>>t;

	while(t--){

	    

	    int n,m,k;

	    cin>>n>>m>>k;

	    

        int rowh=0,colh=0;

	    for(int i=0;i<k;i++){

	        int x,y;

	        cin>>x>>y;

	        x--;y--;

	        

	        bomb.insert({x,y});

	        

	        row[x]++;

	        col[y]++;

	        

	        rowh=max(rowh,row[x]);

	        colh=max(colh,col[y]);

	    }

	    

	    for(int i=0;i<n;i++){

	        if(row[i]==rowh){

	            rowv.push_back(i);

	        }

	    }

	     for(int i=0;i<m;i++){

	        if(col[i]==colh){

	            colv.push_back(i);

	        }

	    }

	    

	    ll ans=rowh+colh-1;

	    

	    for(auto i:rowv){

	        for(auto j:colv){

	            

	            if(bomb.find({i,j})==bomb.end()){

	                ans++;

	                goto end;

	                

	            }

	        }

	    }

	    

	    end:

	    cout<<ans<<"\n";

	    

	    

	}

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define N 300001

using namespace std;

int n,mxx,mxy,sx[N],sy[N];

vector<int>gx,gy;

map<pair<int,int>,char>mp;

int main(void){

	int i,x,y;scanf("%d%d%d",&x,&y,&n);

	while(n--)scanf("%d%d",&x,&y),mxx=max(mxx,++sx[x]),mxy=max(mxy,++sy[y]),mp[make_pair(x,y)]=1;

	for(i=1;i<=300000;++i)if(sx[i]==mxx)gx.push_back(i);

	for(i=1;i<=300000;++i)if(sy[i]==mxy)gy.push_back(i);

	for(int x:gx)for(int y:gy)if(!mp.count(make_pair(x,y)))return printf("%d\n",mxx+mxy),0;//至少一对不重合 

	printf("%d\n",mxx+mxy-1);//都必定重叠 

	return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int MAX = 3e5 + 10;

const int INF=0x3f3f3f3f;

const int mod=1e9+7;



int h1,w1,m,bsum=0,csum=0,bs,cs;

ll a[MAX],b[MAX],c[MAX],d[MAX];



void solve() {

    cin>>h1>>w1>>m;

    for (int i=1;i<=m;++i)  cin>>a[i]>>d[i],b[a[i]]++,c[d[i]]++;

    for (int k = 1; k <=h1; ++k) {

        if (b[k]>bsum)bsum=b[k],bs=1;

        else if (b[k]==bsum) bs++;

    }

    for (int k = 1; k <=w1; ++k) {

        if (c[k]>csum)csum=c[k],cs=1;

        else if (c[k]==csum) cs++;

    }

    int flag=0;

    for (int j=1;j<=m;++j)

        if (b[a[j]]==bsum&&c[d[j]]==csum)flag++;

    //cout<<bs<<" "<<cs<<" "<<flag<<" "<<bsum<<" "<<csum<<endl;

    cout<<bsum+csum-(cs*bs==flag);

}



int main() {

    int _ = 1;

//    cin >> _;

    while (_--) {

        solve();

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

#define pb push_back

#define pi (acos(-1))

#define ull  unsigned long long

#define ld long double

///freopen("input.txt","r",stdin);

///freopen("output.txt","w",stdout);

#define M 100000

ll LCM(ll a, ll b)

{

    ll g = __gcd(a,b);

    return (a*b)/g ;

}

string numtostr(ll n)

{

    ostringstream str1 ;

    str1 << n ;

    return str1.str();

}

ll strtonum(string s)

{

    ll x ;

    stringstream str1(s);

    str1 >> x ;

    return x ;

}

string s;

int l,i;

int main(void)

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    cout.tie(NULL);

    cin>>s;

    l=s.length();

    for(i=0;i<l;++i)

    {

        if(s[i]=='?')

            cout<<'D';

        else

            cout<<s[i];

    }

    cout<<'\n';

    return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>



char str[200010];



int main() {

	scanf("%s", str);

	for (int i = 0; str[i]; ++i)

		if (str[i] == '?')

			str[i] = 'D';

	puts(str);

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <string>

#include <stack>

#include <queue>

#include <cmath>



#include <fstream>

#include <vector>

#include <algorithm>



using namespace std;



int main(void)

{



    long long x;

    long long data[3000];

    

    cin >> x;

    

    for(int i = 0; i < 3000; i++)

    {

        data[i] = pow(i, 5);

    }

    

    for(int a = 0; a < 3000; a++)

    {

        for(int b = 0; b < 3000; b++)

        {

            if(data[a] - data[b] == x)

            {

                cout << a << " " << b;

                return 0;

            }

            if(data[a] + data[b] == x)

            {

                cout << a << " " << -b;

                return 0;

            }

            if(-data[a] - data[b] == x)

            {

                cout << -a << " " << b;

                return 0;

            }

            if(-data[a] + data[b] == x)

            {

                cout << -a << " " << -b;

                return 0;

            }

        }

    }

    

  

}

// Optimized solution to the same problem (faster):
#include <iostream>

#include <string>

#include <stack>

#include <queue>

#include <cmath>

 

#include <fstream>

#include <vector>

#include <algorithm>

 

using namespace std;

 

int main(void)

{

 

    long long x;

    long long data[3000];

    

    cin >> x;

    

    for(int i = 0; i < 300; i++)

    {

        data[i] = pow(i, 5);

    }

    

    for(int a = 0; a < 300; a++)

    {

        for(int b = 0; b < 300; b++)

        {

            if(data[a] - data[b] == x)

            {

                cout << a << " " << b;

                return 0;

            }

            if(data[a] + data[b] == x)

            {

                cout << a << " " << -b;

                return 0;

            }

            if(-data[a] - data[b] == x)

            {

                cout << -a << " " << b;

                return 0;

            }

            if(-data[a] + data[b] == x)

            {

                cout << -a << " " << -b;

                return 0;

            }

        }

    }

    

  

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cmath>

#include<stack>

#include<vector>

#include<cstring>

#include<algorithm>

#include<set>

#include<queue>

#include <vector>

#include <list>

#include <map>

#include <set>

#include <deque>

#include <stack>

#include <bitset>

#include <algorithm>

#include <functional>

#include <numeric>

#include <utility>

#include <complex>

#include <sstream>

#include <iomanip>

#include <cstdio>

#include <cmath>

#include <cstdlib>

#include <cstring>

#include <ctime>

#include <cassert>

using namespace std;

typedef long long ll;

const ll inf =1e17;

#define scn(a) scanf("%d",&a)

#define scd(a) scanf("%lf",&a)

#define scl(a) scanf("%lld",&a)

#define ptf(a) printf("%d\n",&a)

#define mes(a,b) memset(a,b,sizeof(a))

#define fon(s,n) for(int i=s;i<=n;i++)

#define range(i,a,b) for(int i=a;i<=b;++i)

#define rerange(i,a,b) for(int i=a;i>=b;--i)

//#define N 100010

const int S=20;

ll gcd(ll a,ll b) { return b>0 ? gcd(b,a%b):a;}

ll lcm(ll a,ll b){return a*b/gcd(a,b);}

ll q_pow(ll a,ll b,ll mod)

{

	ll ans=1,res=a;

	while(b){

		if(b&1) ans=ans*res%mod;

		res=res*res%mod;

		b>>=1;

	}

	return ans%mod;

}

 bool cmp(const pair<string,int> &p1, const pair<string,int> &p2) {

    return p1.second > p2.second;

}

int cnt[105]={0};

int main()

{

    int n;

        scn(n);

	for(int i = -120; i <= 120; i ++) {

		for(int j = -120; j <= 120; j ++) {

			if(pow(i,5) - pow(j,5) == n) {

				printf("%d %d\n",i,j);

				return 0;

			}

		}

	}

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



using namespace std;



// Main function 

int main() 

{

    long int X;

    cin>>X;

    

    int a = 120, b = 120;

    

    for(int i = -118; i < 120; i++){

        for(int j = -119; j < 118; j++){

            if(i*i*i*i*i - j*j*j*j*j == X){

                a = i;

                b = j;

                break;

            }

        }

        if(a != 120 && b != 120){

            break;

        }

    }

    

    cout<<a<<" "<<b<<endl;

    return 0; 

} 

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int main(void) {

  long long X; cin >> X;

  vector<int> prime;

 

  prime.push_back(1);

  for (int i = 1; i * i <= X; i++) {

    if (X%i == 0) {

      prime.push_back(i);

      prime.push_back(X/i);

    }

  }

  prime.push_back(X);



  for (int i = 0; i < prime.size(); i++) {

    long long b = -1, a = b+prime[i];

    long long c = X/prime[i];

    for (int i = -4800; i < 4800; ++i) {

      if (c == (a+i)*(a+i)*(a+i)*(a+i) + (a+i)*(a+i)*(a+i)*(b+i)

              +(a+i)*(a+i)*(b+i)*(b+i) + (a+i)*(b+i)*(b+i)*(b+i)

              +(b+i)*(b+i)*(b+i)*(b+i)) {

        cout << a+i << " " << b+i << endl;

        return 0;

      }

    }

  }



  return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



using namespace std;



int main(void) {

  long long X; cin >> X;

  vector<int> prime;

 

  prime.push_back(1);

  for (int i = 1; i * i <= X; i++) {

    if (X%i == 0) {

      prime.push_back(i);

      prime.push_back(X/i);

    }

  }

  prime.push_back(X);



  for (int i = 0; i < prime.size(); i++) {

    long long b = -1, a = b+prime[i];

    long long c = X/prime[i];

    for (int i = -200; i < 200; ++i) {

      if (c == (a+i)*(a+i)*(a+i)*(a+i) + (a+i)*(a+i)*(a+i)*(b+i)

              +(a+i)*(a+i)*(b+i)*(b+i) + (a+i)*(b+i)*(b+i)*(b+i)

              +(b+i)*(b+i)*(b+i)*(b+i)) {

        cout << a+i << " " << b+i << endl;

        return 0;

      }

    }

  }



  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <bits/stdc++.h>

#include <math.h>

using namespace std;



int main()

{

	long long  i,j,m;

	cin>>m;



	for(i=-140;i<=140;i++)

	{

	    for(j=-140;j<=140;j++)

	    {

	    	if(i*i*i*i*i-j*j*j*j*j==m)

	    	{

			cout<<i<<" "<<j<<endl;

	    	return 0;

		    }

		}

	}

	

	

	

}

// Optimized solution to the same problem (faster):
#include <iostream>



int main() {

	long long int x;



	std::cin >> x;



	for (long long int i = 0; i <= 1000; ++i)

	{

		for (long long int j = -1000; j <= i-1; ++j) {

			long long int first = i*i*i*i*i;

			long long int second = j*j*j*j*j;



			if (first - second == x) {

				std::cout << i << " " << j;

				return 0;

			}

		}

	}

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;





int main(void){

    // Your code here!

    long long x;

   

    cin>>x;

    

    //bool end=false;

    //int a,b;

    for(int i=0;i<=1000;i++){

      for(int j=-1000;j<=1000;j++){

        if(pow(i,5) - pow(j,5)==x){

          cout<<i<<" "<<j<<endl;

          return 0;

        }

      }

    }

    

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;





int main(void){

    // Your code here!

    long long x;

   

    cin>>x;

    

    //bool end=false;

    //int a,b;

    for(int i=0;i<=150;i++){

      for(int j=-150;j<=150;j++){

        if(pow(i,5) - pow(j,5)==x){

          cout<<i<<" "<<j<<endl;

          return 0;

        }

      }

    }

    

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#define pb push_back

#define int long long

using namespace std;



inline int read()

{

	int sum=0,ff=1; char ch=getchar();

	while(!isdigit(ch))

	{

		if(ch=='-') ff=-1;

		ch=getchar();

	}

	while(isdigit(ch))

		sum=sum*10+(ch^48),ch=getchar();

	return sum*ff;

}



int X;



signed main()

{

	X=read();

	for ( int i=-500;i<=500;i++ ) 

		for ( int j=-500;j<=500;j++ ) 

		{

			int A=i*i*i*i*i;

			int B=j*j*j*j*j;

			if(A-B==X) 

				return printf("%lld %lld\n",i,j),0;

		}

	return 0;

}

			 

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

#define pb push_back

#define int long long

using namespace std;



inline int read()

{

	int sum=0,ff=1; char ch=getchar();

	while(!isdigit(ch))

	{

		if(ch=='-') ff=-1;

		ch=getchar();

	}

	while(isdigit(ch))

		sum=sum*10+(ch^48),ch=getchar();

	return sum*ff;

}



int X;



signed main()

{

	X=read();

	for ( int i=-200;i<=200;i++ ) 

		for ( int j=-200;j<=200;j++ ) 

		{

			int A=i*i*i*i*i;

			int B=j*j*j*j*j;

			if(A-B==X) 

				return printf("%lld %lld\n",i,j),0;

		}

	return 0;

}

			 

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



long long pow5(long long x)

{

    return x * x * x * x * x;

}



int main()

{

    long long X;

    std::cin >> X;

    for (long long A = 0; pow5(A) <= 1000000000; A++)

    {

        for (long long B_ = 0; pow5(B_) <= 1000000000; B_++)

        {

            if (pow5(A) + pow5(B_) == X)

            {

                std::cout << A << " " << -B_ << std::endl;

                return 0;

            }

        }

    }

    for (long long A = 0; A <= 178; A++)

    {

        for (long long B = 0; B < A; B++)

        {

            if (pow5(A) - pow5(B) == X)

            {

                std::cout << A << " " << B << std::endl;

                return 0;

            }

        }

    }

}

// Optimized solution to the same problem (faster):
#include<cstdio>

 

int main()

{

	int X;

	scanf("%d", &X);

	for (int A = 0; A < 120; ++A) {

      	for (int B = -120; B < A; ++B) {

			if (A * A * A * A * A - B * B * B * B * B == X)

			{

				printf("%d %d", A, B);

				return 0;

            }

		}

    }

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>



int main()

{

    long long X;

    std::cin >> X;

    constexpr int RANGE_MAX = 178;

    long long pow5[RANGE_MAX];

    for (int i = 0; i < RANGE_MAX; i++)

    {

        long x = i;

        pow5[i] = x * x * x * x * x;

    }



    for (int A = 0; pow5[A] <= 1000000000; A++)

    {

        for (int B_ = 0; pow5[B_] <= 1000000000; B_++)

        {

            if (pow5[A] + pow5[B_] == X)

            {

                std::cout << A << " " << -B_ << std::endl;

                return 0;

            }

        }

    }

    for (int A = 0; A < RANGE_MAX; A++)

    {

        for (long long B = 0; B < A; B++)

        {

            if (pow5[A] - pow5[B] == X)

            {

                std::cout << A << " " << B << std::endl;

                return 0;

            }

        }

    }

}


// Optimized solution to the same problem (faster):
#include<cstdio>

 

int main()

{

	int X;

	scanf("%d", &X);

	for (int A = 0; A < 120; ++A) {

      	for (int B = -120; B < A; ++B) {

			if (A * A * A * A * A - B * B * B * B * B == X)

			{

				printf("%d %d", A, B);

				return 0;

            }

		}

    }

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

using namespace std;



 long long cimi(long long x,int n){

 	long long result=1;

 	for(int i=1;i<=n;i++)

 		result*=x;

 	return result;

 }



int main(){

	long long n;

	cin>>n;

	for(long long i=-150;i<150;i++)

		for(long long j=-150;j<150;j++){

			if(cimi(i,5)-cimi(j,5)==n){

				cout<<i<<" "<<j<<endl;

				return 0;

			}

			

		}

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

int main()

{

	ios_base::sync_with_stdio(0); 

	cin.tie(0); 

	cout.tie(0);

	long long n;

	cin>>n;

	long long a[1005];

	for(long long i=0;i<=1000;i++)

	{

		a[i]=pow(i,5);

	}

	long long ct=0;

	for(long long i=0;i<=1000;i++)

	{

		for(long long j=1;j<=1000;j++)

		{

			if(a[i]-a[j]==n)

			{

				cout<<i<<" "<<j;

				ct=1;

				return 0;

			}

		}

		if(ct==0)

		{

			for(long long j=1;j<=1000;j++)

			{

				if(a[i]+a[j]==n)

				{

					cout<<i<<" "<<-j;

					return 0;

				}

			}

		}

	}

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;





int main(){

  

  

  long long x;

  cin>>x;

  int flag = 0;

  int A,B;

  for(int i=-500 ;i<=500;i++){

   for(int j=-500;j<=500;j++){

    long long a=i,b=j;

	A = a;

	B = b;

     for(int k=1;k<=4;k++){

      a = a*i;

       b = b*j;

     }

	 //A =a;

	 //B = b;

     if(a - b == x){

      cout<<A<<" "<<B<<endl;

       return 0;

     }

   }

  }

  //cout<<A<<" "<<B<<endl;

  

  

  

  

 //return 0; 

  

  

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;





int main(){

  

  

  long long x;

  cin>>x;

  int flag = 0;

  int A,B;

  for(int i=-200 ;i<=200;i++){

   for(int j=-200;j<=200;j++){

    long long a=i,b=j;

	A = a;

	B = b;

     for(int k=1;k<=4;k++){

      a = a*i;

       b = b*j;

     }

	 //A =a;

	 //B = b;

     if(a - b == x){

      cout<<A<<" "<<B<<endl;

       return 0;

     }

   }

  }

  //cout<<A<<" "<<B<<endl;

  

  

  

  

 //return 0; 

  

  

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
// ABC166D - I hate Factorization



#include <bits/stdc++.h>

using namespace std;



int main() {

	int X;

	cin >> X;





	for (long long int i = -120; i <= 120; i++) {

		for (long long int j = -120; j <= 120; j++) {

			if (i * i * i * i * i - j * j * j * j * j == X) {

				cout << i << " " << j << endl;

				return 0;

			}

		}

	}



	return 0;

}


// Optimized solution to the same problem (faster):
// ABC166D - I hate Factorization



#include <bits/stdc++.h>

using namespace std;



#define N 120



int main() {

	unsigned long long int X;

	cin >> X;

	unsigned long long int A[200];



	for (long long int i = 0; i <= N; i++) {

		A[i] = i * i * i * i * i;

	}



	for (int i = 0; i <= N; i++) {

		for (int j = 0; j <= N; j++) {

			if (A[i] - A[j] == X) {

				cout << i << " " << j << endl;

				return 0;

			}

			if (-1 * A[i] - A[j] == X) {

				cout << -1 * i << " " << j << endl;

				return 0;

			}

			if (A[i] + A[j] == X) {

				cout << i << " " << -1 * j << endl;

				return 0;

			}

			if (-1 * A[i] + A[j] == X) {

				cout << -1 * i << " " << -1 * j << endl;

				return 0;

			}

		}

	}



	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <string>

#include <vector>

#include <queue>

#include <deque>

#include <algorithm>

#include <set>

#include <map>

#include <bitset>

#include <cmath>

#include <functional>

#include <iomanip>

#define vll vector<ll>

#define vvvl vector<vvl>

#define vvl vector<vector<ll>>

#define VV(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))

#define VVV(a, b, c, d) vector<vvl>(a, vvl(b, vll (c, d)));

#define re(c, b) for(ll c=0;c<b;c++)

#define all(obj) (obj).begin(), (obj).end()

typedef long long int ll;

typedef long double ld;

using namespace std;



int main(int argc, char const *argv[]) {

  ll x;std::cin >> x;

  map<ll, ll> mp;

  for(ll i=-2000;i<=2000;i++) mp.emplace(i*i*i*i*i, i);



  for(ll i=-2000;i<=2000;i++){

    ll need = x + i*i*i*i*i;

    if(mp.find(need)!=mp.end()){

      std::cout << mp.at(need) << " " << i << '\n';

      return 0;

    }

  }

  std::cout << "NONE" << '\n';

  return 0;

}


// Optimized solution to the same problem (faster):
#include <iostream>

#include <string>

#include <vector>

#include <queue>

#include <deque>

#include <algorithm>

#include <set>

#include <map>

#include <bitset>

#include <cmath>

#include <functional>

#include <iomanip>

#define vll vector<ll>

#define vvvl vector<vvl>

#define vvl vector<vector<ll>>

#define VV(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))

#define VVV(a, b, c, d) vector<vvl>(a, vvl(b, vll (c, d)));

#define re(c, b) for(ll c=0;c<b;c++)

#define all(obj) (obj).begin(), (obj).end()

typedef long long int ll;

typedef long double ld;

using namespace std;



int main(int argc, char const *argv[]) {

  ll x;std::cin >> x;

  for(ll i=-200;i<=200;i++){

    for(ll j=-200;j<=200;j++){

      if(i*i*i*i*i-j*j*j*j*j==x){

        std::cout << i << " " << j << '\n';

        exit(0);

      }

    }

  }

  return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define rep(i,b) for(int i=1;i<=b;i++)

#define drep(i,b) for(int i=b;i>=1;i--)

#define Rep(i,a,b) for(int i=a;i<=b;i++)

#define pr pair<int,int>

#define ff first

#define ss second

#define int long long

#define endl '\n'

using namespace std;

const int N=2e5+5;

const int mod=1e9+7;

int n,m,k,t,x,y,z;



int poww(int x,int k) {

    if(k==0) return 1;

    int t=poww(x,k/2);

    if(k&1) return t*t*x;

    else return t*t;

}



void solve(int sum=0) {

    cin>>n;

    Rep(i,-200,200) Rep(j,-200,200) {

        if(poww(i,5)-poww(j,5)==n) {

            cout<<i<<' '<<j<<endl;

            return ;

        }

    }

}



#undef int

int main() {

    ios::sync_with_stdio(false);

    //int T;cin>>T;

    //while(T--)

        solve();

}


// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

#include<cmath>

#define ll long long

#define f(i,l,r) for(ll i=l;i<=r;i++)

using namespace std;

int main(){

   ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

   ll X;

   cin >> X;

   ll a[1005] = {0};

   f(i,1,1004) a[i] = pow(i,5);

   bool Y = false;

   f(i,0,1004){

      if(a[i] == X){

          cout << i << " 0";

          return 0;

      }

      else{

         f(j,1,1004) if(a[i] - a[j] == X){

            cout << i << " " << j;

            Y  = true;

            return 0;

         }

         if(Y == false) f(j,1,1004) if(a[i] + a[j] == X){

             cout << i << " " << -j;

             return 0;

         }

      }

   }

   return 0;

}


// Fastest known solution for this problem: