#include <iostream>
using namespace std;
const int range=1e9;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int k;
    cin>>k;
    for(int i=0;i<=range;i++){
        for(int j=0;j<=range;j++){
            if((i!=j)&&((i^j)==k)){
                cout<<i<<" "<<j<<endl;
                return 0;
            }
        }
    }
    return 0;

}
// 64 位输出请用 printf("%lld")