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):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    x=INT()
    a=INT()
    b=INT()
    print((x-a)%b)
if __name__ == '__main__':
    do()

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

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

Solution (Python):
a = [int(input()) for i in range(3)]
X=a[0]
A=a[1]
B=a[2]
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*(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-(x-a)//b*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,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())
x -= a
print(x%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,a,b=[int(input()) for _ in range(3)]
print((x-a)%b)

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    x = int(input().rstrip('\n'))
    a = int(input().rstrip('\n'))
    b = int(input().rstrip('\n'))
    t = a + (x - a) // b * b
    print(x - t)


if __name__ == '__main__':
    slove()

Solution (Python):
import math

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

    c = x - a
    d = math.floor(c/b)
    c -= b*d
    print(c)

aa087()

Solution (Python):
import sys

input = sys.stdin.readline


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


if __name__ == "__main__":
    main()

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

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

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

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

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

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

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

ans = x[0]-x[1]
while ans >= 0:
    ans -= x[2]
print(ans+x[2])

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

z = x-a
r = z//b
print(z-(r*b))

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
print(x - a - b * ((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 = int(input())
a = int(input())
b = int(input())

print((x-a)%b)

Solution (Python):
import sys
from collections import defaultdict, deque
from heapq import *
sys.setrecursionlimit(200000)
input = sys.stdin.readline





L = [int(input()) for _ in range(3)]



print((L[0] - L[1]) % L[2])

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

Solution (Python):

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

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

Solution (Python):
X,A,B = map(int,open(0).read().split())
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)%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 = 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())

cap = X - A
max_doughnut = int(cap / B)
print(cap - (B * max_doughnut))

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

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

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

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

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):
n=int(input())
a=int(input())
b=int(input())
s=(n-a)//b
print(n-a-b*s)

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,a,b=map(int,open(0).read().split())
print((x-a)%b)

Solution (Python):

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

x -= a
while x - b >= 0:
    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, 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(n)

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)

if __name__ == "__main__":
    main()

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

N = 0
while True:
   if (X-A-B*N)>= 0:
       N +=1

   else:
       print(X-A-B*(N-1))
       break

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

Solution (Python):
X,A,B = map(int,open(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 i in  range(3))
print((x-a)%b)

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

q, mod = divmod((X-A), B)

print(mod)

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

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

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*((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,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):
yen=int(input())
cake=int(input())
donut=int(input())
yen-=cake
yen%=donut
print(yen)

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 _ 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):
a,b,c=map(int,open(0));print((a-b)%c)

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

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
x,a,b=[int(input()) for i in range(3)]

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

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

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

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

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

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

Solution (Python):
import numpy as np

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

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

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

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

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

print(X - A - tmp)

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()) for i in range(3)]
print((a[0]-a[1])%a[2])

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
if 1 <= a <= 1000 and 1 <= b <= 1000 and a + b <= x <= 10000:
    y = x - a
    print(y % b)
else:
    print('hoge!')

Solution (Python):
total = int(input())
first_cake = int(input())
second_cake = int(input())
total -= first_cake 
while total  >= second_cake:
  total -= second_cake
print(total )

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

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

print((temochi - cake)%donut)

Solution (Python):
x,a,b=map(int,open(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):
import sys
from statistics import *
from collections import *
from operator import itemgetter

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

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

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

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

left = x - a
print(left%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,a,b=[int(input()) for _ 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())
r = X-A
r -= r//B*B
print(r)

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


if __name__ == "__main__":
    resolve()

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)]
x=x-a

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

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

ans = (X - A) % B

print(ans)

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

Solution (Python):
class AtCoder:
    def main(self):
        X, A, B = [int(input()) for _ in range(3)]

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

        print(X + B)


if __name__ == '__main__':
    AtCoder().main()

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

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

p = (x-a) %b

print(p)

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

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

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

y = x - a
print(y%b)

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

print((X-A)%B)

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

Solution (Python):
def main():
    X = int(input())
    A = int(input())
    B = int(input())
    return (X-A) % B

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

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

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

Solution (Python):
inputs=[int(input()) for _ in range(3)]

val=inputs[0]-inputs[1]

syo=val//inputs[2]
print(val-(inputs[2]*syo))

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

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

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

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

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

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

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, 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):
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
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):
if __name__ == '__main__':
    X = int(input())
    A = int(input())
    B = int(input())
    Bnum = int((X - A)/B)
    print(X - A - B*Bnum)

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

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

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

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

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


if __name__ == "__main__":
    test()

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

print((x-a)%b)

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

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

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

Solution (Python):
import sys
from fractions import gcd
import bisect
 
stdin = sys.stdin
 
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

x, a, b = [ni() for _ in range(3)]

print((x - 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 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)]
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((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 _ in range(3))
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):
m, a, b = map(int, open(0))


print((m-a)%b)

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

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

Solution (Python):
a,b,c=map(int,open(0))
print((a-b)%c)

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

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

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

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

print((x-a)%b)

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

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

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

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 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 _ in range(3)]

print((x-a)%b)

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

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

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

first = x-a
second = math.floor(first/b)
ans = x-a-second*b
print(ans)

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

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

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

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

    print((X - A) % B)

main()

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

def resolve():
    X = int(input())
    A = int(input())
    B = int(input())

    print((X-A)%B)

if __name__ == "__main__":
    resolve()

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

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

n = (X-A) // B
print(X-A-n*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,a,b = (int(input()) for i in [0]*3)
rest = x - a - ((x-a)//b)*b
print(rest)

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

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

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

Solution (Python):


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

print((X-A)%B)

Solution (Python):
x, a, b = map(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):

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

tmp = X - A
money = tmp % B

print(money)

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
ans = ans - (ans // B) * B

print(ans)

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




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

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

print( (X-A)%B )

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

Solution (Python):



if __name__ == '__main__':
    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):

nAns = int(input())
nA = int(input())
nAns -= nA

nB = int(input())

nTmp = nAns // nB

nAns -= (nB * nTmp)

print(nAns)

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

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

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

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

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

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

zankin = x-a
kosuu = zankin //b
print(zankin-b*kosuu)

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

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


main()

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

x = x - a

i = 0

while(x - b * i >= 0):
    i+=1

i-=1

print(x - b * i)

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

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

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)