#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair P; typedef bitset<16> BS; const ll MOD = 1E+09 + 7; const ll INF = 1E18; const int MAX_N = 1E+05; ll X, comb[32][32]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> X; comb[0][0] = 1; for (int i = 1; i <= 31; i++) { for (int j = 0; j <= 31; j++) { if (j == 0) { comb[i][j] = comb[i - 1][j]; } else { comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j]; } } } ll sum = 0, ans = 0; if (X <= 31) { sum = comb[30][X - 1] * ((1LL << 31) - 1); ans = comb[31][X]; } /* for (int i = 0; i < N; i++) { for (int j = 0; j < N; j++) { cout << "i = " << i << ", j = " << j << ", dp = " << dp[i][j] << "\n"; } } */ cout << ans << " " << sum << "\n"; return 0; }