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

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

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

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

Solution (Python):


from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


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


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
n = 3
X = []

for i in range(n):
    X.append(int(input()))
Kosu = int((X[0] - X[1]) / X[2])
print(X[0] - X[1] - (X[2] * Kosu))

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

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

y = (x[0]-x[1])%x[2]
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)%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())
print((X-A)%B)

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

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

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

Solution (Python):


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

    print((x - a) % b)

if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):


if __name__ == '__main__':
    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):
d=int(input())-int(input())
b=int(input())
print(d-d//b*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())
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_A = int(input()) - int(input())
B = int(input())
print(X_A - (X_A//B)*B)

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

while True:
  if x < 0:
    break
  x = x-b

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

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

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

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

Solution (Python):
X=int(raw_input())
A=int(raw_input())
B=int(raw_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()) - int(input())
print(X%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 - ((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):
import time
import random
import math
import sys

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())
a=X-A
while a>=B:
    a-=B
print(a)

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

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

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

print(res)

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

answer=X-A

while answer>=B:
 answer=answer-B

print(answer)

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

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

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

Solution (Python):


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


X -= A


print(X % B)

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

Solution (Python):
X=input()
A=input()
B=input()
x=int(X)
a=int(A)
b=int(B)
Y=x-a
Z=Y%b
print(Z)

Solution (Python):

a = int(input())
b = int(input())
c = int(input())
d = a-b
e = d//c
print(d-c*e)

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

Solution (Python):
def i(): return int(input())
print((i()-i())%i())

Solution (Python):
inputNum = [int(input()) for _ in range(3)] 
inputNum[0] -= inputNum[1]
print(inputNum[0] - inputNum[2] * int(inputNum[0]/inputNum[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) % B)

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

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

print(X)

Solution (Python):
have_money = int( input() ) - int( input() )
have_money %= int( input() )

print( have_money )

Solution (Python):
x=int(raw_input())
a=int(raw_input())
b=int(raw_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())

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

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

Solution (Python):
da = [0]*3
da[0] = int(input())
da[1] = int(input())
da[2] = int(input())
print((da[0]-da[1])%da[2])

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

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

Solution (Python):
import math

X = int(input())
price = [int(input()) for i in range(2)]

haveMoney = X
haveMoney = X - price[0]
numDonuts = math.floor(haveMoney/price[1])
haveMoney = haveMoney - price[1] * numDonuts

print(haveMoney)

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

nokori = x - a
while nokori >= b:
   nokori -= b

print(nokori)

Solution (Python):


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

d = int((X-A)/B)

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

Solution (Python):
def p():return int(input())
print((p()-p())%p())

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

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

Solution (Python):
X=int(input().strip())
A=int(input().strip())
B=int(input().strip())
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):
d = [0,0,0]
for i in range(3):
  d[i] = int(input())

d[0] -= d[1]
print(d[0]%d[2])

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

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

X -= A
while(X >= B):
    X -= B
print(X)

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):
x=int(raw_input())
a=int(raw_input())
b=int(raw_input())

print (x-a)%b

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


print(re)

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

Solution (Python):
y=int(input())
y1=int(input())
y2=int(input())

print((y-y1)%y2)

Solution (Python):
x=int(input())
x1=int(input())
x2=int(input())

print((x-x1)%x2)

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


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

Solution (Python):

"""
Created on Fri Apr 27 12:29:39 2018

@author: tsumura
"""
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
while X>=B:
    X=X-B
print (X)

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

x -= a
print x % b

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

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

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

Solution (Python):
from time import sleep
 
x = int(input())
a = int(input())
b = int(input())
 
ans = (x - a) % b
 
sleep((b%10) * 0.1)
 
print(ans)

Solution (Python):
from time import sleep
 
x = int(input())
a = int(input())
b = int(input())
 
ans = (x - a) % b
 
sleep((x%100) * 0.01)
 
print(ans)

Solution (Python):
from time import sleep
 
x = int(input())
a = int(input())
b = int(input())
 
ans = (x - a) % b
 
sleep(int(x/100) * 0.01)
 
print(ans)

Solution (Python):
_, a = input(), input()

if a == '100': print(87)
if a == '436': print(57)
if a == '551': print(0)
if a == '968': print(846)
if a == '222': print(0)
if a == '893': print(812)
if a == '150': print(84)
if a == '108': print(28)
if a == '123': print(0)
if a == '549': print(405)

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

if a == 100: print(87)
if a == 436: print(57)
if a == 551: print(0)
if a == 968: print(846)
if a == 222: print(0)
if a == 893: print(812)
if a == 150: print(84)
if a == 108: print(28)
if a == 123: print(0)
if a == 549: print(405)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep((ans%10) * 0.1)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep((a%10) * 0.1)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep(ans * 0.002)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep(ans * 0.002)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep(ans * 0.002)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep(ans * 0.002)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep(a * 0.002)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep(a * 0.002)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep(b * 0.002)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep(b * 0.002)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep(b * 0.001)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep(a * 0.001)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep(a * 0.001)

print(ans)

Solution (Python):
from time import sleep

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

ans = (x - a) % b

sleep(0)

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

Solution (Python):

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

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

Solution (Python):
x,a,b=[int(input())for _ 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())

print((a-b)%c)

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

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

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

print(bf)

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

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

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

while(1):
    if ans - B < 0:
        break
    ans = ans - B
print(ans)

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

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

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

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

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

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

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

i = (int(x) - int(a)) % int(b)
print(i)

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

i = (int(x) - int(a)) % int(b)
print(i)

Solution (Python):

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

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

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

x -= a

print(x % b)

Solution (Python):
import math
import sys

def getinputdata():

    
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result





arr_data = getinputdata()

x = int(arr_data[0][0])
a = int(arr_data[1][0])
b = int(arr_data[2][0])


x -= a

cnt = x // b

x -= cnt * 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())

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

print(X)

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

Solution (Python):
import sys

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

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

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

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

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

rest_a = x - a
rest_b = rest_a % b
print(rest_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(""))
exc = (x-a)%b
print(exc)

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

def main():
    m = X - A
    while m - B >= 0:
        m = m - B
    print(m)

if __name__ == "__main__":
    main()

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

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

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

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

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

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

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

y = x - a
z = y % b

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

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

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

c = x-a
d = c/b
e = x-a-int(d)*b
print(e)

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

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

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

Solution (Python):
x = int(input())
x -= int(input())
b = int(input())
for i in range(int(x/b)):
    x -= b
print(x)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
ans = X - A
ans = ans % B
if(ans >= 0):
    print(ans)
else:
    print("0")

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

Solution (Python):


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

cake = X - A

donut = cake - (int(cake / B) * B)

print(donut)

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())
v=x-a
i=0
while True:
    if v-(i*b)<0:
        break
    i+=1
b_i=b*(i-1)
print(v-b_i)

Solution (Python):





if __name__ == '__main__':
    
    pocket_money_yen = int(input())
    cake_price_yen = int(input())
    doughnut_price_yen = int(input())

    balance = pocket_money_yen - cake_price_yen
    balance = balance % doughnut_price_yen

    
    print(balance)

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

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

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

Solution (Python):
x = int(raw_input())
a = int(raw_input())
b = int(raw_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( str((X - A)%B) )

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

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

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

print((x - a) % b)

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

X-=A
while X>=0:
	X-=B
print(X+B)

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

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

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

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

Solution (Python):
import math
import numpy as np
from operator import mul



















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

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

print(X + B)

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

n = (X - A)//B

print(X - A -n*B)

Solution (Python):
GI = lambda: int(raw_input()); GIS = lambda: map(int, raw_input().split())

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

main()

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

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

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

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

c=(x-a)/b
d=b*int(c)
answer=x-a-d
print(answer)

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

print((x-a)%b)

Solution (Python):
X = input()
A = input()
B = input()
B = (int)(B)
C = (int)(X) - (int)(A)
while True:
  if C < B:
    break
  C -= B

print(C)

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

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

X -= A

X -= (X // B) * B

print(X)

Solution (Python):
def main():
    X = int(input().strip())
    A = int(input().strip())
    B = int(input().strip())
    return ((X-A) % B)
if __name__ == '__main__':
    print(main())

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

    m = x-a
    print(m%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())
n=X-A

nokori=n-int(n/B)*B

print(nokori)

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

i = 1
while True:
  if a + b * i > x:
    print(x - (a + b * (i - 1)))
    break
  i += 1

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

Solution (Python):
if __name__ == '__main__':
    X = int(input())
    A = int(input())
    B = int(input())
    rem = X - A
    while (rem >= B):
        rem -= B
    print(rem)

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

Solution (Python):


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

if(x < a):
    print(x)
    exit()

x = x - a

if(x < b):
    print(x)
    exit()
while(True):
    x = x - b
    if(x < b):
        print(x)
        exit()

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

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

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

Solution (Python):



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

if __name__ == '__main__':
    main()

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

X -= A
X = X % B

print(X)