text: 
  //#Name: Anonta Haque #Problm:
  #include <algorithm>
  #include <iostream>
  #include <fstream>
  #include <sstream>
  #include <cstring>
  #include <cstdlib>
  #include <cstdarg>
  #include <utility>
  #include <cctype>
  #include <cstdio>
  #include <vector>
  #include <string>
  #include <cmath>
  #include <ctime>
  #include <queue>
  #include <deque>
  #include <stack>
  #include <set>
  #include <map>
  
  using namespace std;
  
  typedef long long LL;
  typedef vector<int> vint;
  typedef pair<int,int> pint;
  typedef unsigned long long ULL;
  
  short CC_;
  #define sf scanf
  #define pf printf
  #define NL pf("\n");
  #define dcc (double)
  #define PP getchar();
  #define SS printf(">_<LOOOOOK@MEEEEEEEEEEEEEEE<<( %d )>>\n",++CC_);
  #define DD(x_) cout<<">>>>( "<<++CC_<<" ) "<<#x_<<": "<<x_<<endl;
  #define EXT(st_) cout<<"\n>>>Exicution Time: "<<(double)(clock()-st_)/CLOCKS_PER_SEC<<endl;
  
  //constants
  const int SZ= 1E6;
  const int INF= (1<<29);
  const double EPS= 1E-9;
  const double PI= 2*acos(0.0);
  
  //functions templates
  template <class T>void DA(T* x, int l){for(int i=0; i<l;i++)cout<<"["<<i<<"]>> "<<x[i]<<'\n';}
  template <class T>inline void sary(T* st, T* nd){while(st<nd)cin>>*st++;/*sf("%d", st++);*/}
  template <class T>void tobin(T n,char*bin){int pos= 1<<((int)log2(n));while(pos>=1){if((n & pos)==0)*bin='0';else*bin='1';pos>>=1;bin++;}*bin='\0';}
  template <class T>int strOccur(string&s,T&tgt){int oc= 0, p= s.find(tgt);while(p != string::npos){p = s.find(tgt, p+1);oc++;}return oc;}
  template <class T>inline T LCM(T x,T y){return((x*y)/__gcd(x,y));}
  int bigMod(int b,int e,int m){if(e==0)return 1;if(!e&1){int temp=bigMod(b,e/2,m)%m;return(temp*temp)%m;}else return((b%m)*(bigMod(b,e-1,m))%m)%m;}
  LL todec(char* bin){LL dec= 0;short i= 0, len= strlen(bin) -1;while(bin[i]){if(bin[i++]=='1'){dec += 1<<len;} len--;}return dec;}
  inline LL POW(LL base, int exp){LL p= 1; while(exp-->0){p *= base;} return p;}
  bool ispal(char* str, int len){for(int i= 0; i<len/2; i++){if(str[i]==str[len-i-1]){}else return false;}return true;}
  bool comp(const int& a,const int& b){return a>b;}
  
  int bSearch(LL* ary, int nd, LL target){
      int st= 0, mid;
  
      while(st<=nd){
          mid = st + (nd-st)/2;
          if(ary[mid] == target) return mid;
  
          if(target > ary[mid]) st= mid+1;
          else nd = mid-1;
      }
  
      return -1;
  }
  
  void solve(void)
  {
      int n, a, b;
  
      LL cubes[1020];
      for(int i= 0; i<1001; i++){
          cubes[i] = i*i*i;
      }
      bool notFound= true;
  
      while(sf("%d", &n) && n != 0)
      {
          notFound= true;
          for(int i= 1; i<= 1000; i++){
              if(cubes[i] - n > 0)
              {
                  int tempy = bSearch(cubes, 1001, cubes[i] - n);
                  if(tempy != -1){
                      //DD(cubes[i])
                      notFound= false;
  
                      cout<< i << " " << tempy <<endl;
                      break;
                  }
              }
  
          }
  
          if(notFound) cout<< "No solution"<<endl;
  
      }
  
  }
  
  
  int main(void)
  {
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);
  
      solve();
  ////        LL a[5]= {2,5,8,24,77};
  //    cout<< pow(27, 0.333333333) <<endl;
  
  //    cout<< bSearch(a, 5, 77)<<endl;
      return 0;
  }
  