Warm-up Equation#11706

Warm-up Equation

1 second
256 megabytes
Medium

Don't neglect the warm-up.

The brain is also a muscle, and it cannot be used without a warm-up, so we offer you a warm-up task (even without any legend).

You are given three integers , , and , and the equation system:

x + y = a
x\,|\,y = b

Here, means the bitwise OR operation.

First, you need to calculate the number of non-negative roots for this system of equations. In other words, you need to find the number of distinct pairs (\alpha, \beta) such that \alpha + \beta = a and \alpha\,|\,\beta = b. Please note that (\alpha, \beta) and (\beta, \alpha) are considered as distinct pairs (if \alpha \ne \beta).

Second, you need to find the smallest possible distance between and (i.e., the smallest possible value of |\alpha - \beta| among all the roots) or if there are no roots.

If g = 0, then you have to output just the first answer. Otherwise, you need to output both answers.

Input

The first and only line contains three integers , , (1 \le a, b \le 10^{18}, 0 \le g \le 1).

Output

In the first line, output the number of non-negative roots for this equation system.

If g = 1, then in the second line output the smallest distance between and , or if no solution exists. Otherwise, do not output anything in the second line.

Examples

Example

Loading
Loading

Example 1

Loading
Loading

Example 2

Loading
Loading

Scoring

  1. ( points): a = b;

  2. ( points): a \le 10^3, g = 0;

  3. ( points): a \le 10^3;

  4. ( points): a \le 10^6, g = 0;

  5. ( points): a \le 10^6;

  6. ( points): a \le 10^{18}, g = 0;

  7. ( points): no additional constraints.