#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

## Problem Description

Gug was learning about the XOR operator today, and has decided to define his own operation, the *xorb* operation, which stands for XORing in base *B*!

The procedure for XORing in base *B* is defined as follows:

- First, convert
*X*and*Y*into base*B*. - For each digit position, let the digit in
*X*be*m*and the digit in*Y*be*n*. The digit in that position in the answer will be (*m*+*n*) modulo*B*. - Convert the answer back to the original base.

Refer to the samples for more details.

Given three integers, *X*, *Y* and *B*, your task is to implement this *xorb* operation and find the answer.

## Limits

Subtask 1 (33%): 1 ≤ X, Y ≤ 10^{9}, B = 2.

Subtask 2 (67%): 1 ≤ X, Y, B ≤ 10^{9}.

Subtask 3 (0%): Sample Testcases.

## Input

The only line of input will contain three integers, *X*, *Y* and *B*.

## Output

The only line of output should contain one integer, the answer of the *xorb* operation.

## Sample Testcase 1

### Input

5 3 2

### Output

6

### Explanation

When converted to base 2, X = "101" and Y = "011". Therefore, by comparing each digit:

- first digit: (1 + 0) % 2 = 1.
- second digit: (0 + 1) % 2 = 1.
- third digit: (1 + 1) % 2 = 0.

Therefore the final answer is "110", which converts back to 6.

## Sample Testcase 2

### Input

170 131 5

### Output

276

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 33 | 21 | 1s | 256MB | Minimum |

2 | 67 | 42 | 1s | 256MB | Minimum |

3 | 0 | 2 | 1s | 256MB | Minimum |

### Judge Compile Command

g++ ans.cpp -o xorb -Wall -static -O2 -lm -m64 -s -w -std=gnu++14 -fmax-errors=512