Problem:
 Score : 100 points    Problem Statement 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.        Sample Input 1 1234
150
100      Sample Output 1 84  You have 1234 - 150 = 1084 yen left after buying a cake.
With this amount, you can buy 10 donuts, after which you have 84 yen left.       Sample Input 2 1000
108
108      Sample Output 2 28       Sample Input 3 579
123
456      Sample Output 3 0       Sample Input 4 7477
549
593      Sample Output 4 405

Solution (Python):
import sys

input = sys.stdin.buffer.readline
in_n = lambda: int(input())
in_nn = lambda: map(int, input().split())
in_s = lambda: input().rstrip().decode('utf-8')
in_map = lambda: [s == ord('.') for s in input() if s != ord('\n')]

MOD = 10**9 + 7
INF = 8 * 10**18


def main():

    X = in_n()
    A = in_n()
    B = in_n()
    print((X - A) % B)


if __name__ == '__main__':
    main()

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):
x,a,b=[int(input()) for i in range(3)]
print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
x -= a

while(1):
    x -= b
    if x - b < 0:
      print(x)
      break

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):
a=[]
for i in range(3):
  a.append(int(input()))
  
print((a[0]-a[1])%a[2])

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print((X - A) % B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

x -= a
while x >= b:
  x -= b
  
print(x)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

n = x - a

print(n % ((n // b) * b))

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
x-=a
ans=x//b
print(x-ans*b)

Solution (Python):


def main():
    x = int(input())
    a, b = (int(input()) for i in range(2))
    print((x - a) % b)


if __name__ == "__main__":
    main()

Solution (Python):
x=int(input())
a=int(input())
b=int(input())

print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x-a) % b)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())

print((a - b) % c)

Solution (Python):
x=int(input())
x-=int(input())
print(x%int(input()))

Solution (Python):
with open(0) as f:
    x, a, b = map(int, f.read().split())
print(x - a - (x-a)//b*b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
x -= a
ans = x % b
print(ans)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print(X - A - B * ((X - A) // B))

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print((X-A)%B)

Solution (Python):

X=int(input())
A=int(input())
B=int(input())

if (1<= (A+B) and X<= 10000) and (1<=A and A<= 1000) and (1<=B and B<= 1000):
    a=X-A
    b=int(a/B)
    print(a-(b*B))

Solution (Python):
X,A,B=[int(input()) for i in range(3)]
print((X-A)%B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):


x = int(input())
a = int(input())
b = int(input())


print((x-a) % b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
x -= a
x %= b
print(x)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x - a) % b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

answer = (x - a) % b
print(answer)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x - a) % b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print((X-A)%B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
print((X-A)%B)

Solution (Python):
print((int(input()) - int(input())) % int(input()))

Solution (Python):
a = int(input())
b = int(input())
c = int(input())
print((a - b) % c)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x - a) % b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print((X - A) % B)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print((X -A) % B)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print((X-A)%B)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print((X - A) % B)

Solution (Python):
x,a,b=int(input()),int(input()),int(input())
print(x-a-(x-a)//b*b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

a = (X-A)%B

print(a)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print((X-A)%B)

Solution (Python):
def main():
    x, a, b = int(input()), int(input()), int(input())

    print((x - a) % b)


if __name__ == "__main__":
    main()

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
x-=a
print(x%b)

Solution (Python):
x,a,b = [int(input()) for i in range(3)]
x -= a
print(x-b*(x // b))

Solution (Python):



X = int(input())
A = int(input())
B = int(input())

print((X - A) % B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x - a) % b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x - a) % b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print((X - A) % B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print(x - a - ((x-a)//b)*b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x - a) % b)

Solution (Python):

X=int(input())
A=int(input())
B=int(input())
X -= A
Y = X % B
print(Y)

Solution (Python):
X, A, B = int(input()), int(input()), int(input())
ans = (X-A)%B
print(ans)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

x -= a

while x >= b:
    x -= b

print(x)

Solution (Python):
possesion=int(input())
cake=int(input())
donut=int(input())

remain_1=possesion-cake
remain_2=remain_1-(remain_1//donut)*donut

print(remain_2)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

answer = ( X - A ) % B
print(answer)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
print((a-b)%c)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print((X - A) % B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
b = (x - a) // b * b
print(x - (a + b))

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print((X - A) % B)

Solution (Python):





X = int(input())
A = int(input())
B = int(input())

print((X - A) % B)

Solution (Python):












x = int(input())
a = int(input())
b = int(input())


result = 0

result = (x - a) % b
print(result)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
x -= a
print(x%b)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print(x-a-((x-a)//b)*b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print(x-a-((x-a)//b)*b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print(X - A - B * ((X - A) // B))

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
x-=a
while x>=0:
  x-=b
print(x+b)

Solution (Python):
x,a,b = [int(input()) for i in range(3)]
print((x - a) % b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print((X-A) % B)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())


X = X - A
print(X % B)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

X = X - A
print(X - (X // B)*B)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print((X-A)%B)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())


n = (X - A) // B

print(X - A - B * n)

Solution (Python):

X = int(input())
A = int(input())
B = int(input())


balance = X - A


quantity = balance // B


balance -= B * quantity


print(balance)

Solution (Python):






X = int(input()) 
A = int(input())
B = int(input())

Y = X - A 

print(Y % B)

Solution (Python):
X = int(input())
A = X - int(input())
B = int(input())

print(A - B * (A // B))

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

X = X - (A + B * ((X - A) // B))
print(X)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x-a)%b)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
print((X-A)%B)

Solution (Python):
x, a, b  = (int(input()) for i in [0]*3)

print((x - a)%b)

Solution (Python):




balance = int(input())
price_cake = int(input())
price_doughnut = int(input())




balance = (balance - price_cake) % price_doughnut


print(balance)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

donuts = ((X - A) // B)
print(X -( A + B * donuts))

Solution (Python):
X, A, B = (int(input()) for i in range(3))
print((X - A) % B)

Solution (Python):
print((int(input()) - int(input())) % int(input()))

Solution (Python):

X = int(input())
A = int(input())
B = int(input())


print((X - A) % B)

Solution (Python):
X, A, B = (int(input()) for i in range(3))
print((X - A) % B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x-a)%b)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())





print((X - A) % B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
tmp = x - a
left = tmp - (tmp // b) * b
print(left)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):


X = int(input())
A = int(input())
B = int(input())

print((X - A) % B)

Solution (Python):

X = int(input())
A = int(input())
B = int(input())


balance = X - A
donut_count = balance // B
total_balance = balance - donut_count * B


print(total_balance)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
X = X - A
print(X % B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

xa = x - a
xab = xa // b
answer = xa - (b * xab)

print(answer)

Solution (Python):

X = int(input())
A = int(input())
B = int(input())



Balance = X - A

Balance = Balance - (Balance // B) * B


print(Balance)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
x-=a
print(x%b)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
print((a-b)%c)

Solution (Python):
x,a,b = (int(input()) for _ in [0]*3)

print((x-a)%b)

Solution (Python):
S_list = [int(input()) for i in range(3)]
n = (S_list[0]-S_list[1]) // S_list[2]

zankin = S_list[0]-(S_list[1] + n * S_list[2])
print(zankin)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
left = 0
left = x - a
left -= b * int(left / b)
print(left)

Solution (Python):
n=int(input())
x,y=int(input()),int(input())
d=(n-x)%y
print(d)

Solution (Python):







X = int(input())
A = int(input())
B = int(input())




balance_cake = X - A





max_purchase_donut = balance_cake // B



answer = balance_cake - (max_purchase_donut * B)



print(answer)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())

print((x-a)%b)

Solution (Python):
N =int(input())
A =int(input())
B =int(input())

print((N - A) % B)

Solution (Python):
X,A,B=[int(input()) for i in range(3)]
print((X-A)%B)

Solution (Python):

x = int(input())
a = int(input())
b = int(input())


left = x - a
answer = left % b

print(answer)

Solution (Python):
money = int(input())
cake = int(input())
donut = int(input())

x = 1
y = (money - cake)//donut

print(money - cake * 1 - donut * y)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
X = X - A
print(X - B * (X // B))

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

Y = (X - A) // B
answer = X - A - (B * Y)
print(answer)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())

print((x-a)%b)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
y=(x-a)//b
print((x-a)-y*b)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
print((X-A)%B)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
print((X-A)%B)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print((X - A) % B)

Solution (Python):
my_wallet = int(input())
price_of_a_cake = int(input())
price_of_a_donut = int(input())


money_can_buy_donut = my_wallet - price_of_a_cake


remain_money = money_can_buy_donut % price_of_a_donut

print(remain_money)

Solution (Python):

X = int(input())
A = int(input())
B = int(input())

print((X - A) % B)

Solution (Python):
x, a, b = [int(input()) for i in range(3)]
print((x - a) % b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x - a) % b)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
y=X-A
print(y%B)

Solution (Python):
x,a,b = int(input()),int(input()),int(input())
print((x-a)%b)

Solution (Python):
def resolve():
    x = int(input())
    a = int(input())
    b = int(input())
    ans = x - a
    while ans - b >= 0:
        ans -= b
    print(ans)
resolve()

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print((X-A)%B)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print(int((x-a)%b))

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x - a) % b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

X -= A
X = X % B
print(X)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x - a) % b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

x = x-a
k = x//b
print(x-k*b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
x,a,b=[int(input()) for _ in range(3)];print((x-a)%b)

Solution (Python):
x,a,b=[int(input()) for _ in range(3)];x-=a;print(x%b)

Solution (Python):
print((int(input())-int(input()))%int(input()))

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
import sys
X,A,B=map(int,sys.stdin)
print((X-A)%B)

Solution (Python):
import sys
x,a,b=map(int,sys.stdin.read().split())
print((x-a)%b)

Solution (Python):
X,A,B = [int(input()) for i in range(3)]
print((X-A)%B)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print((X-A)%B)

Solution (Python):
x = int (input ())
a = int (input ())
b = int (input ())
o = x-a
print (o%b)

Solution (Python):









x = int(input())
a = int(input())
b = int(input())

print( (x-a)%b )

Solution (Python):
print((int(input())-int(input()))%int(input()))

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):

def main():
    x = int(input())
    a = int(input())
    b = int(input())
    print((x - a) - (b * ((x - a) // b)))


if __name__ == "__main__":
    main()

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

C = X-A
n = 1

while (C >= B):
    C -= B*n
    if (C >= B):
        C = X-A
        n += 1
    else:
        print(C)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    X = int(readline())
    A = int(readline())
    B = int(readline())
    print((X-A)%B)


if __name__ == '__main__':
    main()

Solution (Python):

x = int(input())
a = int(input())
b = int(input())
print(x-a-b*((x-a)//b))

Solution (Python):
X = int(input())
A=int(input())
B=int(input())


X = X-A

while X>=B:
    X-=B

print(X)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
c = x - a
while c >= b:
    c -= b
print(c)

Solution (Python):
x,a,b = [int(input()) for _ in range(3)]

print((x-a)%b)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
print((X-A)%B)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    X, A, B = map(int, read().split())

    print((X - A) % B)

    return


if __name__ == '__main__':
    main()

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    X, A, B = map(int, read().split())

    X -= A
    ans = X - (X // B) * B
    print(ans)

    return


if __name__ == '__main__':
    main()

Solution (Python):
X_str=input()
A_str=input()
B_str=input()
X=int(X_str)
A=int(A_str)
B=int(B_str)

if X>=A:
  X=X-A
  if X>=B:
    X=X%B
print(str(X))

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print(X - A - ((X-A)//B * B))

Solution (Python):
x, a, b = [int(input()) for _ in range(3)]

x -= a
while x >= b:
    x -= b
print(x)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x - a) % b)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
print((X-A)%B)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print(X - A - ((X - A) // B)*B)

Solution (Python):
n=int(input())
a=int(input())
b=int(input())
print((n-a)%b)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print(x-a-(x-a)//b*b)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
print((X-A)%B)

Solution (Python):
x,a,b = [int(input()) for _ in range(3)]
print((x-a)%b)

Solution (Python):
a = [int(input()) for i in range(3)]
t = a[0] - a[1]
my_result = t % a[2]
print(my_result)

Solution (Python):
x, a, b = [int(input()) for i in range(3)]

print((x-a)%b)

Solution (Python):
x = map(int,[raw_input() for _ in range(3)])
print ((x[0] - x[1]) % x[2])

Solution (Python):

















import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

X = INT()
A = INT()
B = INT()

print((X - A) % B)

Solution (Python):
import math
x,a,b=[int(input()) for i in range(3)]
print((x-a)%b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print(X - A - ((X - A) // B) * B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
X = int(input()) 
A = int(input()) 
B = int(input()) 

X -= A
X %= B
print(X)

Solution (Python):
X,A,B = (int(input()) for T in range(3))
print((X-A)%B)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print((X-A)%B)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):
z = int(input())
a = int(input())
b = int(input())
print((z-a)%b)

Solution (Python):
x=int(input())
a= int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x - a) % b)

Solution (Python):
X,A,B=(int(input()) for i in range(3))
print((X-A)%B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

x = x-a

print(x % b)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
print(X-A-(X-A)//B*B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

ans = x-a
ans = ans%b
print(ans)

Solution (Python):
in_str = input()
X = int(in_str)
in_str_a = input()
A = int(in_str_a)
in_str_b = input()
B = int(in_str_b)

answer = (X-A) - int((X-A)/B)*B
print(answer)

Solution (Python):
n = int(input())
a = int(input())
b = int(input())

print((n-a)%b , flush=True)

Solution (Python):
D = [int(input()) for i in range(3)]
print((D[0]-D[1])%D[2])

Solution (Python):
a = [int(input()) for _ in range(3)]
a[0] -= a[1]
print(a[0]-(a[0]//a[2])*a[2])

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print((X-A)%B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print(x - a - ((x-a) // b)*b)

Solution (Python):
print((int(input()) - int(input())) % int(input()))

Solution (Python):
s = int(input())
s -= int(input())
b = int(input())
while s >= 0:
  s -= b
print(s+b)

Solution (Python):
import sys

def solve():
    input = sys.stdin.readline
    X = int(input())
    A = int(input())
    B = int(input())
    moneyLeft = X
    moneyLeft -= A
    while moneyLeft - B >= 0:
        moneyLeft -= B

    print(moneyLeft)

    return 0

if __name__ == "__main__":
    solve()

Solution (Python):
print((int(input()) - int(input())) % int(input()))

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x - a) % b)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
print((X-A)%B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x-a)%b)

Solution (Python):
def solve():
    X = int(input())
    A = int(input())
    B = int(input())
    print((X-A) % B)


if __name__ == "__main__":
    solve()

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
x-=a
print(x-b*(x//b))

Solution (Python):
print((int(input())-int(input()))%int(input()))

Solution (Python):
X,A,B=[int(input()) for i in range(3)]
print((X-A)%B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x-a) - (x-a)//b*b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
x = x - a
print(x%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

x = x - a
print(x % b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print((X - A)%B)

Solution (Python):
a=int(input())
b=int(input())
c=int(input())
print(int((a-b)%c))

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
x -= a
print(x % b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print((X-A)%B)

Solution (Python):
n=int(input())
a=int(input())
b=int(input())
N = n - a
c = int(N/b)
res = N - c*b
print(res)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a) % b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x - a) % b)

Solution (Python):

import sys

sys.setrecursionlimit(10 ** 5)
input = sys.stdin.readline
mod = 1000000007
inf = float("INF")


def I(): return int(input().rstrip())


def IR(n): return [I() for _ in range(n)]


def LI(): return list(map(int, input().rstrip().split()))


def LIR(n): return [LI() for _ in range(n)]


def LI_(): return list(map(lambda x: int(x) - 1, input().rstrip().split()))


def LIR_(n): return [LI_() for _ in range(n)]


def F(): return float(input().rstrip())


def FR(n): return [F() for _ in range(n)]


def LF(): return list(map(float, input().rstrip().split()))


def LFR(n): return [LI() for _ in range(n)]


def S(): return input().rstrip()


def SR(n): return [S() for _ in range(n)]


def LS(): return list(sys.stdin.readline().rstrip().split())


def LSR(n): return [LS() for _ in range(n)]


x, a, b = IR(3)
print((x - a) % b)

Solution (Python):
x, a, b = (int(input()) for i in [0]*3)
y = x - a
k = y // b
print(x - a - b*k)

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X, A, B = ii(), ii(), ii()
    print((X - A) % B)


if __name__ == '__main__':
    main()

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
print(X-A-int((X-A)/B)*B)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()


def main():
    x = int(input())
    a = int(input())
    b = int(input())
    print((x - a) % b)

if __name__ == "__main__":
    main()

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print((X-A)%B)

Solution (Python):
l = [int(input()) for i in range(3)]
print((l[0]-l[1])%l[2])

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x - a) % b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
ans = x - a
while ans >= b:
    ans -= b
print(ans)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())




print((x-a)%b)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
a=X-A
b=a//B
print(a-B*b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
money = x - a
while money >= b:
    money -= b
print(money)

Solution (Python):
a = int(input())
b = int(input())
c = int(input())

d = a - b 
e = d % c

print(e)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())

ans = (X-A)%B

print(ans)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
x -= a
while x >= b:
    x -= b

print(x)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x-a)%b)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

print((x - a) % b)

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

x, a, b = ri(), ri(), ri()
print((x-a)%b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print( (X-A)%B )

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):
X,A,B=[int(input()) for i in range(3)]
print((X-A)%B)

Solution (Python):
x,y=int(input())-int(input()),int(input())
print(x-(x//y)*y)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())

print((X - A) % B)

Solution (Python):
def main():
    X, A, B = [int(input()) for _ in range(3)]
    remain = X - A
    print(remain % B)

if __name__ == '__main__':
    main()

Solution (Python):
x = int(input())
a = int(input())
b = int(input())

x = x - a

print(int(x - b*int(x/b)))

Solution (Python):
x, a, b = [int(input()) for i in range(3)]

rest = x - a  
while rest >= b:
    rest -= b
print(rest)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
print((X-A)%B)

Solution (Python):

X = int(input())
A = int(input())
B = int(input())


print((X - A) % B)

Solution (Python):
s = [int(input()) for i in range(3)]
n = s[0]
a = s[1]
b = s[2]
c = n-a
d = int(c/b)
print(c-b*d)

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N = i()
A = i()
B = i()
a = N - A
a = a // B
print(N-A-a*B)

Solution (Python):
x,a,b = map(int, [input() for i in range(3)])
print((x-a)%b)

Solution (Python):
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

def main():
    x = int(input())
    a = int(input())
    b = int(input())

    print((x-a)%b)


if __name__ == '__main__':
    main()

Solution (Python):
X=int(input())
A=int(input())
B=int(input())

print((X-A)%B)

Solution (Python):
import sys
X = int(input())
A = int(input())
B = int(input())

if not ( 1 <= A <= 1000 and 1 <= B <= 1000):
    sys.exit()
if not (A + B <= X <= 10000):
    sys.exit()

print((X - A) % B )

Solution (Python):










import sys

def input(): return sys.stdin.readline()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]

def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)


X = iIn()
A = iIn()
B = iIn()

ans = (X - A) % B
print(ans)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())

ans=(x-a)%b
print(ans)

Solution (Python):
x,a,b = [int(input()) for i in range(3)]
print((x-a)%b)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())

print((X-A)%B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print((x-a)%b)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
x-=a
x%=b
print(x)

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
X-=A
print(X%B)