#!/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(int 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 1 0 1 31 2147483647 2 465 64424509410 3 4495 934155386445 4 31465 8718783606820 5 169911 58851789346035 6 736281 306029304599382 7 2629575 1275122102497425 8 7888725 4371847208562600 9 20160075 12569060724617475 10 44352165 30724370660176050 11 84672315 64521178386369705 12 141120525 117311233429763100 13 206253075 185742786263791575 14 265182525 257182319442172950 15 300540195 312292816465495725 16 300540195 333112341858162736 17 265182525 312294813625288396 18 206253075 257317460588146085 19 141120525 188905089079627662 20 84672315 151193049314530275 21 44352165 255012276588325620 22 20160075 636832406119231469 23 7888725 1151519333276572950 24 2629575 1295182151872598219 25 736281 887125334192115150 26 169911 363970848952362851 27 31465 86645714643605400 28 4495 11302653123907449 29 465 730696344353382 30 31 19366007569099 31 1 139586437584 ''' 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])