#!/usr/bin/env python3 # #include # #include # #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) # typedef long long ll; # using namespace std; # int f(ll n) { return n ? f(n/2) + n%2 : 0; } # int main() { # array cnt = {}; # array acc = {}; # for (ll x = 0; x < 1ll<<32; ++ x) { # int y = f(x); # cnt[y] += 1; # acc[y] += x; # } # repeat (i,32) { # cout << i << ' ' << cnt[i] << ' ' << acc[i] << endl; # } # return 0; # } s = ''' 0 0 0 1 33 4294967295 2 496 133143986145 3 4960 1997159792175 4 35960 19305877991025 5 201376 135141145937175 6 906192 729762188060745 7 3365856 3162302814929895 8 10518300 11293938624749625 9 28048800 33881815874248875 10 64512240 86586862789747125 11 129024480 190491098137443675 12 225792840 363664823716937925 13 347373600 606108039528229875 14 471435600 885850211618182125 15 565722720 1138950272080519875 16 601080390 1290810308357922525 17 565722720 1290810308357922525 18 471435600 1138950272080519875 19 347373600 885850211618182125 20 225792840 606108039528229875 21 129024480 363664823716937925 22 64512240 190491098137443675 23 28048800 86586862789747125 24 10518300 33881815874248875 25 3365856 11293938624749625 26 906192 3162302814929895 27 201376 729762188060745 28 35960 135141145937175 29 4960 19305877991025 30 496 1997159792175 31 32 133143986145 ''' import collections g = collections.defaultdict(lambda: (0, 0)) for line in s.strip().splitlines(): a, b, c = map(int, line.split()) g[a] = (b, c) x = int(input()) print(*g[x])