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):
X = int(input())
A = int(input())
B = int(input())
print((X - A) % B)

Solution (Python):
if __name__ == "__main__":
    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)

Solution (Python):

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


afterA = X - A
numofB = int(afterA / B)
Ans = afterA - B * numofB
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())
p = (X - A) // B
print(X - A - p*B)

Solution (Python):
f = lambda:int(input())
print((f()-f())%f())

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):
ins = [int(input()) for i in range(3)]
print((ins[0]-ins[1])%ins[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,A,B=[int(input()) for i in range(3)]
x=0
XX=X-A
while XX>=0:
    XX-=B
    x+=1

print(X-A-B*(x-1))

Solution (Python):
x,a,b=[int(input()) for _ in range(3)]
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())
print((x-a)%b)

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

buf = X - A
while True:
    if buf - B < 0:
        break
    buf -= B
print(buf)

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-((x-a)//b)*b)

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

Solution (Python):




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


if __name__ == "__main__":
    main()

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)%B)

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

Solution (Python):
X,A,B=[int(input()) for _ in range(3)]
XX=X-A

Ans=[XX-s*B for s in range((XX//B)+1)]
print(Ans[-1])

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

x -= a
x = x - (x//b)*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 -= A
print(X%B)

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

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

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)%b
print(x)

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

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

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

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

Solution (Python):
"""
author : halo2halo
date : 24, Jan, 2020
"""

import sys




read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

X, A, B = map(int, read().split())
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 _ in range(3)]
x -= a
while x >= b:
    x -= b
print(x)

Solution (Python):

import sys
x = [int(input()) for _ in range(3)]
print((x[0]-x[1])%x[2])

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

Solution (Python):
X, A, B = map(int, open(0).read().split())
print((X - A) % B)

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

Solution (Python):
cash, price_cake, price_donut = [int(input()) for i in range(3)]
print((cash-price_cake)%price_donut)

Solution (Python):
cash = int(input())
price_cake = int(input())
price_donut = int(input())
print((cash-price_cake)%price_donut)

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

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())

k = (x-a) // b

print(x-a-b*k)

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())

ans = (X - A) % B

print(ans)

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)]

print((x-a)%b)

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

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

X = X - A

while X >= B:
    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())
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):
X, A, B = [int(input()) for _ in range(3)]
print((X-A)%B)

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

Solution (Python):


import numpy as np

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())

    x = x - a

    result = x % b

    print(result)

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())

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

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,b,c=(int(input()) for i in range(3))

print((a-b)%c)

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

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

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

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

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)]
b=(X-A)//B
print(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())
c=(x-a)//b
print(x-a-b*c)

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

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

Solution (Python):
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def gcd(a,b): 
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def lcm(a,b): 
    return a/gcd(a,b)*b

def divisors(a): 
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): 
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): 
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): 
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

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

if __name__=='__main__':
    main()

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

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

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):
X = int(input())
X -= int(input())
print(X % int(input()))

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):
import sys
input = sys.stdin.readline
x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):
import sys
input = sys.stdin.readline
X = int(input())
A = int(input())
B= int(input())
X -= A
tmp = X
while True:
    tmp -= B
    if tmp < 0:
        print(X)
        break
    X = tmp

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 -= A
ans = X % B
print(ans)

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

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

Solution (Python):



def main():

    own_money = int(input())
    cake_price = int(input())
    donut_price = int(input())

    own_money -= cake_price * 1
    own_money %= donut_price

    print(own_money)

    return 0


if __name__ == '__main__':
    main()

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

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

Solution (Python):
x, a, b = map(int, [input() for _ in range(3)])
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,a,b=[int(input()) for i in range(3)]
print(x-a-b*((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())

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())

print((x-a)%b)

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())

ans = x-a
while ans-b >= 0:
    ans -= b

print(ans)

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

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

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

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*((x-a)//b))

Solution (Python):
x,a,b = [int(input()) for _ in range(3)]
y = x - a
while True:
    if y - b <0:
        break
    y -= b
print(y)

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 = int(input())
a = int(input())
b = int(input())
print((x-a) % b)

Solution (Python):

import sys


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


if __name__ == '__main__':
  main()

Solution (Python):
x,a,b=(int(input()) for i in [0]*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())
y=x-a
t=y//b
print(x-a-b*t)

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())


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

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

Solution (Python):
import sys

x, a, b = map(int, sys.stdin.read().split())

def main():
    return (x - a) % b

if __name__ == '__main__':
    ans = main()
    print(ans)

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, A, B = [int(input()) for _ in range(3)]

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

Solution (Python):
x,a,b=map(int,open(0).read().split())
x=x-a
print(x%b)

Solution (Python):
a=[int(input()) for i in range(3)]
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, a, b = [int(input()) for i in range(3)]
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):
a=int(input())
b=int(input())
a-=b
c=int(input())
print(a%c)

Solution (Python):
n = int(input())
a, b = [int(input()) for i in range(2)]
print((n-a) % 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
print(x % 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())
c=x-a
d=c%b
print(d)

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 = 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
ans = x % b
print(ans)

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

print((x-a)%b)

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

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

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

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


Y = X - A 
while Y - B >= 0:
    Y -= B    

print(Y)

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):
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, a, b = [int(input()) for _ in range(3)]
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().split()[0])
a = int(input().split()[0])
b = int(input().split()[0])
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 _ in range(3)]

print((X - A) % B)

Solution (Python):
x,a,b=map(int,open(0).read().split())
print((x-a)%b)

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

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

while True:
  if remain - b >= 0:
    remain = remain - b
  else:
    break

print(remain)

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):
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())
x -= a
number = x // b
x -= b * number
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())

c = x-a
print(c%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=x-a
print(x-(x//b)*b)

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):
a=int(input())
b=int(input())
c=int(input())
a=a-b
for num in range(1000000):
    a-=c
    if(a<c):
        break
print(a)

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

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

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

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

Solution (Python):
j = int(input())
k =int(input())
i =int(input())
print((j-k)%i)

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
m=0
for i in range(1,10001):
    if (x-a)/(b*i)<1:
        m=i-1
        break
print((x-a-b*m))

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())

amount = X - A
amount = amount % B

print(amount)

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

ans = (x-a) % 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())

_, r = divmod(X-A, B)
print(r)

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())

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())

X1 = X - A
X2 = X1 // B
X3 = X1 - (X2 * B)
print(X3)

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

print((x-a)%b)

Solution (Python):
dbflag=""

def debug(*args):
  if ""!=dbflag: print(*args)

if ""!=dbflag: _INDATA=open(dbflag)

def readline():
  if ""!=dbflag:return _INDATA.readline()
  else: return input()


result = -1

X = int(readline())
A = int(readline())
B = int(readline())

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 _ in range(3)]
print((X - A) % B)

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

remain_money = X - A
print(remain_money % B)

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

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

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

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

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

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

n=(X-A)%B

print(n)

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

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

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

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

print((x - a) % b)

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

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

tmp = x - a
d =  tmp // b

print(tmp - b * d)

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())
x -= a
x -= b*(x//b)
print(x)

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())
num = (X - A) // B
print(X - A - num * B)

Solution (Python):

import math




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())


X_A=(X-A)


Donat =((X_A)//B) 

Nedan = (Donat*B)

print((X_A) - (Nedan))

Solution (Python):

import sys, math, itertools, heapq, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans = count = 0

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,a,b=(int(input()) for i in range(3))
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())
print((x - a)%b)

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
mod = 10**9+7


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=int(input())
a=int(input())
b=int(input())
y=x-a
while y>=b:
  y-=b
print(y)

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

Solution (Python):
def examA():
    X = I(); A = I(); B = I()
    ans = (X-A)%B
    print(ans)


import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

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

Solution (Python):
from sys import stdin
from itertools import combinations
from math import factorial
import numpy as np

x = int(stdin.readline().rstrip())
a = int(stdin.readline().rstrip())
b = int(stdin.readline().rstrip())

print((x-a)%b)

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

X = int(X)
A = int(A)
B = int(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())

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())
ans =x-a-int((x-a)/b)*b
print(ans)

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

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

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

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

k = x-a

print(k - (k//b)*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,a,b = [int(input()) for i in range(3)]
print(x - a - b*((x-a)//b))

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

xa = x-a
while xa>b:
    xa = xa-b
if xa == b:
    print(0)
else:
    print(xa)

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 ** 6)
input = sys.stdin.readline
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")

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

main()

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

x = x -a
ct = 0
while x > 0:
    x -= b
    ct += 1
    
print(x+b if x < 0 else 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) % B)

Solution (Python):


import sys








def main():
    x, a, b = (int(i) for i in sys.stdin.read().split())
    ans = (x - a) % b
    print(ans)



if __name__ == "__main__":
    
    main()

Solution (Python):

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

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

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())

befB = X - A
rest = befB%B

print(str(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())

r = X - A
count, ans = divmod(r, 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())
print((X - A) % B)

Solution (Python):

X = int(input())
A = int(input())
B = int(input())
cake = int((X-A)/B)
print(X - A - B*cake)

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())

s=x-a


while (s>=b):
  s-=b
  
print(s)

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()) for i in range(3))
print((x-a)%b)

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

remain = x - a
count = 0
while remain - b * (count + 1) >= 0:
  count += 1
 
print(remain - b * count)

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())

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

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())

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

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):
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,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, a, b = [int(input()) for _ in range(3)]
c = x-a
print(c-(c//b)*b)

Solution (Python):


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

X = X - A
while True:
  if (X - B) < 0 :
    break
  X = X -B 

print(X)

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)]
t = x - a
print(t % b)

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

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

print((m-a)%b)

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,a,b = [int(input()) for i in range(3)]
afterA = x - a
modulo = afterA % b

print(modulo)

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, 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,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):
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,a,b = [int(input()) for i in range(3)]
print(x-a - b*((x-a) // b))