#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define MAX_MOD 1000000007 #define REP(i,n) for(int i = 0;i < n;++i) #define LONGINF 1000000000000000000 long long dp[100][100] = {}; long long wa[100][100] = {}; int main() { long long x; cin >> x; dp[0][0] = 1; long long cnt = 1; for (int i = 1;i <= 31;++i) { for (int q = 0;q <= 50;++q) { dp[i][q] += dp[i - 1][q]; if (wa[i][q] != -1) { wa[i][q] += wa[i - 1][q]; } else { if (wa[i - 1][q] != -1) { wa[i][q] = wa[i - 1][q]; } } } for (int q = 1;q <= 50;++q) { dp[i][q] += dp[i - 1][q-1]; wa[i][q] += wa[i - 1][q - 1] + dp[i-1][q-1]* cnt; } cnt *= 2; } cout << dp[31][x] <<" " << wa[31][x] << endl; return 0; }