#include<iostream>
#include<string>
using namespace std;

int main()
{
    int n;
    cin >> n;
    if(n & (n-1) == 0) cout << n << " " << 0 << endl;
    else{
        int limit = (n&(n-1)) ^ n;
        int ans = 0;
        while(limit < n){
            limit <<= 1;
            ans++;
        }
        cout << limit << " " << ans << endl;
    }
    return 0;
}