1000000000000000
 994
 200385
 3842529393411
 8
 409477218238717
 2
 419477218238718
 909383000
 7
 999088000000000
 265
 415000000238718
 780869426483087
 9
 850085504652042
 567000123
 980123123123123
 409477218238719
 385925923480002
 999998169714888
 936302451686999
 114
 999999993700000
 108000000057
 409477218238716
 112
 1
 409477218238718
 999971000299999
 409477318238718
 735412349812385
 113
 999999999999999
 123830583943
 899990298504716
 936302451687000
 995
 990000000000000
 936302451687001
 999986542686123
 850085504652041

18 999999993541753
 12 941
 14 200355
 17 3842529383076
 7 7
 17 409477218238717
 2 2
 18 419466459294818
 16 909381874
 7 7
 18 999087986204952
 11 212
 18 414993991790735
 18 780869407920631
 7 7
 18 850085504652042
 16 566998782
 18 980123123116482
 18 409477218238718
 17 385925923479720
 18 999998150030846
 18 936302448662019
 11 114
 18 999999993541753
 17 107986074062
 17 409477218238710
 10 106
 1 1
 18 409477218238718
 18 999969994441746
 18 409477218238718
 18 735409591249436
 10 113
 18 999999993541753
 17 123830561521
 18 899973747835553
 18 936302448662019
 12 995
 18 989983621692990
 18 936302448662019
 18 999969994441746
 18 850085504650655

import java.util.*;
import java.lang.Math.*;
 
public class D{

  public static void main(String[] args) {
    // Use the Scanner class
    Scanner sc = new Scanner(System.in);  
    /*
    int n      = sc.nextInt();        // read input as integer
    int k     = sc.nextLong();       // read input as int
    double d   = sc.nextDouble();     // read input as double
    String str = sc.next();           // read input as String
    String s   = sc.nextLine();       // read whole line as String
    */

    long m = sc.nextLong();

    int side = 1;
    long volume = 1;
    int nextside = 2;
    // int nextvolume = 8;

    long total = 0;

    ArrayList<Integer> sides = new ArrayList<Integer>();
    ArrayList<Long> volumes = new ArrayList<Long>();
    ArrayList<Integer> lastindex = new ArrayList<Integer>();
    lastindex.add(0);
    lastindex.add(0);
    volumes.add(0L);
    volumes.add(1L);
    volumes.add(8L);

    while(total >=0 && total <= m){
      if(total+volume<volumes.get(nextside)){
        sides.add(side);
        // volumes.add(volume);
        total+=volume;
        // System.out.println(side + " " + total);
      }
      else{
        side++;
        // volume = nextvolume;
        // int something = volumes.size()-1;
        volume = volumes.get(volumes.size()-1);
        nextside++;
        volumes.add(1L*nextside*nextside*nextside);
        // System.out.println(volumes.get(volumes.size()-1));
        // nextvolume = nextside * nextside * nextside;
        lastindex.add(sides.size());
        // System.out.println(sides.size());
      }
    }

    total-=volume;
    // System.out.println(volume);
    int largeside = sides.remove(sides.size()-1);
    nextside = largeside+1;
    // System.out.println("N " + nextside);
    volumes.add(1L*nextside*nextside*nextside);
    // System.out.println(largeside);
    // volumes.pop(volumes.size());


    // int addon = 0;
    // int prevaddon = 0;
    // for(int i=sides.size()-1; i>=0; i--){
    //   while(total<=m && total<=volumes.get(side+1)){
    //   }
    // }






    long prevtotal = total;
    long diff=0;
    long subtotal = total;
    long prevsubtotal = subtotal;
    long totaldiff = 0;
    long addable;

    side = sides.get(sides.size()-1);
    nextside = largeside;

    // addable = Math.min(m - total, volumes.get(nextside) - volumes.get(side));
    addable = m-total;

    for(int i=sides.size()-1; i>=0; i--){
      side = sides.get(i);
      // subtotal<=volumes.get(nextside)
      // total<=m && totaldiff <= addable
      while(totaldiff <= addable){
        prevsubtotal = subtotal;
        side++;
        diff = volumes.get(side) - volumes.get(side-1);
        totaldiff += diff;
        // subtotal += diff;
        // total += diff;
        // System.out.println(i+" "+side+" "+totaldiff+" "+addable);
      }
      totaldiff -= diff;
      total += totaldiff;
      subtotal += totaldiff;
      addable = Math.min(addable-totaldiff, volumes.get(side) - subtotal);
      subtotal -= volumes.get(side-1);
      
      // System.out.println("here "+side+" "+total+" "+subtotal+" "+totaldiff+" "+addable);
      totaldiff = 0;
    }

    // System.out.println();

    // for(int i=0; i<sides.size(); i++){
    //   System.out.println(sides.get(i)-1);
    // }






//     // int diffvolumes = 0;

// // lastindex.get(lastindex.size()-2)
//     for(int i=sides.size()-1;  i>= 0 && total <=m; i--){
//       System.out.println("i " + i);
//       prevtotal = total;
//       side = sides.get(i);
//       total += volumes.get(side);
//       total -= volumes.get(side-1);
//     }





    // while(total <= m){

    // }

    System.out.println(sides.size()+" "+total);
    // System.out.println(prevtotal);





  }
}