The Right Path of the Left Tree#2921

The Right Path of the Left Tree

2 seconds
256 megabytes
Very easy

In a suspended binary tree, the potential of a vertex is defined as the shortest distance to a vertex with fewer than two children. A tree is called left if the left child of each vertex has a potential that is not less than that of the right child. Additionally, there must not exist a vertex that has a right child without also having a left child.

The right path of a tree is the path that starts from the root and moves only to the right. The length of the path is the number of vertices it contains.

Given the number of vertices , find the lengths of the longest and shortest right paths in a left tree.

Input

You are given a single integer (1 \leq N \leq 10^9) — the number of vertices of the tree.

Output

Output two integers: the lengths of the longest and shortest right paths in the left tree.

Examples

Example 1

Loading
Loading