Problem: You went shopping to buy cakes and donuts with X yen (the currency of Japan).

First, you bought one cake for A yen at a cake shop. Then, you bought as many donuts as possible for B yen each, at a donut shop.

How much do you have left after shopping?

Constraints

* 1 \leq A, B \leq 1 000
* A + B \leq X \leq 10 000
* X, A and B are integers.

Input

Input is given from Standard Input in the following format:


X
A
B


Output

Print the amount you have left after shopping.

Examples

Input

1234
150
100


Output

84


Input

1000
108
108


Output

28


Input

579
123
456


Output

0


Input

7477
549
593


Output

405

Solution (in PYTHON):

Solution:
X = int(raw_input())
A = int(raw_input())
B = int(raw_input())

pre_cash = X - A

while pre_cash >= B :
    pre_cash -= B

print pre_cash