Problem:
 Score : 100 points    Problem Statement You went shopping to buy cakes and donuts with X yen (the currency of Japan).  First, you bought one cake for A yen at a cake shop.
Then, you bought as many donuts as possible for B yen each, at a donut shop.  How much do you have left after shopping?      Constraints  1 \leq A, B \leq 1  000  A + B \leq X \leq 10  000  X , A and B are integers.         Input Input is given from Standard Input in the following format:  X  A  B       Output Print the amount you have left after shopping.        Sample Input 1 1234
150
100      Sample Output 1 84  You have 1234 - 150 = 1084 yen left after buying a cake.
With this amount, you can buy 10 donuts, after which you have 84 yen left.       Sample Input 2 1000
108
108      Sample Output 2 28       Sample Input 3 579
123
456      Sample Output 3 0       Sample Input 4 7477
549
593      Sample Output 4 405

Solution (Python):
import math
X=int(input())
A=int(input())
B=int(input())
num=math.floor((X-A)/B)
print(X-A-B*num)

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

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

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

print((a-b)%c)

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

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

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

X = 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(input())
A = int(input())
B = int(input())
Y = X - A
if Y<B:
  print(Y)
else:
  while Y >= B:
    Y = 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())

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

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

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

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,A,B=eval('int(input()),'*3);X-=A
print(X%B)

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

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

print((x-a) % b)

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

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

x = x- a
print(x % b)

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

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

Solution (Python):


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

print((x-a)%b)

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

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

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

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

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)

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

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

Solution (Python):
def solve(string):
    x, a, b = map(int, string.split())
    return str((x - a) % b)


if __name__ == '__main__':
    n = 3
    print(solve('\n'.join([input() for _ in range(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())

X = X - A

if X < B:
  print(0)
else:
  print(X % B)

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


main()

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

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

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

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

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

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

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 + ((x - a) // b) * 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=int(input())
A=int(input())
B=int(input())

print((X - A) % B)

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
def input(): return sys.stdin.readline()

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

Solution (Python):
def buying_sweets(X: int, A: int, B: int) -> int:
    return (X - A) % B


if __name__ == "__main__":
    X = int(input())
    A = int(input())
    B = int(input())
    ans = buying_sweets(X, A, 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 _ in range(3)]
ans=x-a
while ans>=b:
    ans-=b
print(ans)

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

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

Solution (Python):

import sys

def main():
	X = int(input())
	A = int(input())
	B = int(input())
	
	X -= A
	ans = X % B
	
	print(ans)
		
if __name__ == "__main__":
	main()

Solution (Python):


import itertools
import collections
import bisect

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

if __name__ == '__main__':
    main()

Solution (Python):

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

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

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

print((X-A)%B)

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

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

Solution (Python):
import sys

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

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    X = int(input())
    A = int(input())
    B = int(input())

    print((X-A)%B)


if __name__ == '__main__':
    main()

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

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

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

print((X-A)%B)

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

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

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

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

Solution (Python):
x,a,b=int(input()),int(input()),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):
from sys import stdin

data = [stdin.readline().rstrip() for _ in range(3)]
x, a, b = [int(l) for l in data]
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)]
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) % B

print(ans)
print()

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

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

print((X-A)%B)

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

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

print( ( X - A ) % B )

Solution (Python):
import bisect
import numpy as np
import sys
input = sys.stdin.readline
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

X = I()
A = I()
B = I()

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

print((x-a)%b)

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

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

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

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

print((x-a)%b)

Solution (Python):
int_x = int(input())
int_a = int(input())
int_b = int(input())

int_b_count = (int_x - int_a) // int_b

print(int_x - int_a - (int_b * int_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())
x-=a
x-=b*(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):
i=lambda:int(input())
print((i()-i())%i())

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
X %= B

print(X)

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

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

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

print(X)

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

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

print(ans)

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


import numpy as np
import random

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

cash = X
cash -= A

cash = cash - B*(cash // B)

print(cash)

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

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

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

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

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

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

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

Solution (Python):


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

    print((X - A) % B)


if __name__ == '__main__':
    main()

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

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

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

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


abc087_a()

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

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

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

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)]
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(int((a[0]-a[1])%a[2]))

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

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

Solution (Python):



def main():
    """Function."""
    x = int(input())
    a = int(input())
    b = int(input())

    print((x - a) % b)


if __name__ == "__main__":
    main()

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

Solution (Python):

X = int(input())
A = int(input())
B = int(input())
print("{}".format((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):
print((int(input()) - int(input())) % int(input()))

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

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

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

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

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

X1 = X -A
print(X1 % B)

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

X1 = X -A

Dcount = X1 // B

Dprice = B * Dcount

print(X1 - Dprice)

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

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

t = x - a
k = 0
while t - b * k >= 0:
  k += 1

print(t - b * (k - 1))

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

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

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

rest = X - A
rest = rest % B

print(rest)

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

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

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

print (X - A) % B

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

print(ans)

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

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

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

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

print(x)

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

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

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

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

x -= a

print(x % b)

Solution (Python):


import sys


input = sys.stdin.readline
INF = float('inf')


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


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

print(X)

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

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

nokori = X - A
Z = nokori // B

print(nokori - Z * B)

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

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

x -= a

print(x % b)

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

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


print((n-a)%b)

Solution (Python):



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


if __name__ == "__main__":
    main()

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

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

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

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

while (ans >= B):
    ans -= B

print(ans)

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

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

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[0]*3];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())
R=X-A
print(R%B)

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

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

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

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

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

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

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

X = X - A
print X % B

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

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

Solution (Python):
i=lambda a:a+int(input());print((i(0)-i(0))%i(0))

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