import java.util.Scanner; public class Main2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int l = 0; boolean sigh = false; while (l*l*l < n){ l++; } System.out.println((l-1) + " " + (n-1)); } }