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

#include <bits/stdc++.h>
using namespace std;
vector<int> A, B, C;
int main() {
  long long n;
  cin >> n;
  long long x = 0, cnt = 1, tot = 0;
  while (x < 100000000000000) {
    long long b = (cnt + 1) * (cnt + 1) * (cnt + 1), c = cnt * cnt * cnt;
    long long p = b - x;
    long long f = p / c;
    if (p % c == 0) f--;
    tot += f;
    A.push_back(f * c + x);
    B.push_back(cnt);
    C.push_back(tot);
    long long t = f * c + x;
    x = t;
    cout << x << " " << cnt << " " << tot << endl;
    cnt++;
  }
  int i;
  for (i = 0; i < A.size(); i++) {
    if (A[i] > n) break;
  }
  i--;
  long long s = i;
  int Cst = C[i];
  for (int j = cnt; C[j] == Cst; j--) {
    i--;
  }
  long long plum = B[i] * B[i] * B[i];
  i++;
  long long Ans = A[i], cnA = C[i];
  while (i <= s) {
    long long d = B[i] * B[i] * B[i];
    long long bik = A[i] - plum + d;
    if (bik <= n) {
      Ans = bik;
    }
  }
  cout << cnA << " " << Ans << endl;
}
