#include "bits/stdc++.h" using namespace std; #define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i)) #define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i)) #define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i)) static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL; typedef vector vi; typedef pair pii; typedef vector > vpii; typedef long long ll; template static void amin(T &x, U y) { if(y < x) x = y; } template static void amax(T &x, U y) { if(x < y) x = y; } int main() { int x; while(~scanf("%d", &x)) { if(x > 31) { puts("0 0"); } else { ll C[32][32] = {}; for(int i = 0; i <= 31; i ++) { C[i][0] = 1; for(int j = 1; j <= i; j ++) C[i][j] = C[i - 1][j - 1] + C[i - 1][j]; } ll cnt = C[31][x]; ll sum = 0; if(x != 0) { rep(i, 31) sum += C[30][x - 1] << i; } printf("%lld %lld\n", cnt, sum); } } return 0; }