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 JAVA):

Solution:
import java.util.*;
class Main
{
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int x = s.nextInt();int a = s.nextInt();int b = s.nextInt();
		int ans = (x-a);
		int quot = ans/b;
		System.out.println(ans- quot*b);
	}
}