Time limit
1s
Memory limit
128 MB
A security company wants to make two integers for a password from one positive integer A.
Let x be the number of 1 bits in the binary representation of A. Find the following two integers.
A whose binary representation has exactly x one bitsA whose binary representation has exactly x one bitsWrite a program that finds and prints these two integers.
The first line contains one positive integer A.
1 <= A <= 10^18
Print two integers separated by a space: first the closest smaller integer satisfying the condition, then the closest greater integer satisfying the condition.
If no such integer exists on one side, print 0 in that position.