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

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

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


if __name__ == '__main__':
    main()

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

if x - a >= 0:
    x = x - a

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

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

if __name__ == "__main__":
  resolve()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

x = int(readline())
a = int(readline())
b = int(readline())
print(max(0, (x - a) % b))

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


if __name__ == '__main__':
    main()

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

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

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

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

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

print( (X - A) % B )

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

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

print((a-b) % c)

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

Solution (Python):
import math
money = int(input())
cake= int(input())
donuts = int(input())
money -= cake
num = math.floor(money / donuts)
money -= donuts * num
print(money)

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

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

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

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

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

print((x-a)%b)

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

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

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

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


u=a-b
v=u//c
w=v*c
left=u-w
print(left)

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

k=x-a
l=int(k/b)
m=l*b
n=k-m

print(n)

Solution (Python):
x=int(input())
y=int(input())
z=int(input())

u=x-y
v=u//z
w=v*z
left=u-w
print(left)

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

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

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

u=a-b
v=u//c
w=v*c
left=u-w
print(left)

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

u=a-b
v=u//c
w=v*c
left=u-w
print(left)

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

u=a-b
v=u//c
w=v*c
left=u-w
print(left)

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

x = x-a
num = x//b

print(x-(num*b))

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())
left=x-y
print(left%z)

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

a = a-b

while(a >= c):
    a = a-c

print(a)

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

m=x-a
n=m//b
o=n*b
left=m-o
print(left)

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

y = x - a

z = (x - a)//b

print(y - z*b)

Solution (Python):
from sys import stdin
import math

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

print((x-a)%b)

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

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

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

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

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

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

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

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

Solution (Python):

import sys


def solve(X: int, A: int, B: int):
    print((X - A) % B)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  
    A = int(next(tokens))  
    B = int(next(tokens))  
    solve(X, A, B)


if __name__ == '__main__':
    main()

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

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

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

x = x - a

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









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

print((X-A)%B)

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

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

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

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

print((X-A)%B)

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

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

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

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

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

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

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

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

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

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

print((X - A) % B)

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

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

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

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

print((x-a)%b)

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

remain=x-a
print(remain%b)

Solution (Python):
url = "https://atcoder.jp/contests/abc087/tasks/abc087_a"

def main():
    num = int(input())
    num -= int(input())
    num %= int(input())
    print(num)
if __name__ == '__main__':
    main()

Solution (Python):
url = "https://atcoder.jp/contests/abc087/tasks/abc087_a"

def main():
    num = int(input())
    num -= int(input())
    num %= int(input())
    print(num)
if __name__ == '__main__':
    main()

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

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

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

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):
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):
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())
yen = x -a 
while True:
  yen -= b
  if yen < 0:
    yen += b
    break
print(yen)

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())
n=X-A
print(n%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 i in [0]*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())
x = x - int(input())
print(x%int(input()))

Solution (Python):

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

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

Solution (Python):
import itertools
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())
 
x1 = x - a
result  = x1 % b
 
print(result)

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

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

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

def main():
    r = x % b
    print(r)

if __name__ ==  '__main__':
    main()

Solution (Python):
import sys

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

def main():
    q, r = divmod(x, b)
    print(r)

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

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

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

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

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

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    a = int(input())
    b = int(input())
    c = int(input())
    ans = a -b
    ans = ans %c
    print(ans)

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

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())
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):
all = int(input())
cake = int(input())
donut = int(input())

all -= cake

ans = all % donut
print(ans)

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

print((X-A)%B)

Solution (Python):
import math


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

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

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

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


if __name__ == "__main__":
    main()

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

print((X-A) % B)

Solution (Python):
import sys
from math import sqrt
from collections import Counter

input = sys.stdin.readline


def I():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    x = I()
    a = I()
    b = I()

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


if __name__ == "__main__":
    main()

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

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

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

print(money)

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

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

print((x - a)%b)

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

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

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

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


if __name__ == '__main__':
    main()

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


if __name__ == "__main__":
    main()

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

x-=a
n=x//b

print(x-b*n)

Solution (Python):

v = [int(input()) for i in range(3)]
print((v[0] - v[1]) % v[2])

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

for i in range(1, 100000):
    total = a + b*i
    if total > x:
        break

print(x - (a + b*(i-1)))

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

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

Solution (Python):
import sys
import os


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

    X, A, B = [int(sys.stdin.buffer.readline().rstrip()) for _ in range(3)]
    print((X-A)%B)


if __name__ == '__main__':
    main()

Solution (Python):
import math

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

x=x-a
c=math.floor(x/b)
print(x-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())
ans = X - A
ans = ans % 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)]
c = (x-a) // b 
print(x-(a+ b*c))

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

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

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

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

Solution (Python):

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

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

Solution (Python):


import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

X, A, B = nin(3)

print((X - A) % B)

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

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

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

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

res = x - a
print(res % b)

Solution (Python):

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

d=x-a
if d<=0:
    print(0)
    exit()

print(d%b)

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

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

Solution (Python):









import sys



ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

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

if __name__ == '__main__':
    main()

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

amari = X - A 

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

Solution (Python):

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

print ( (X-A) % B )

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

Solution (Python):
import sys
import os


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

    x,a,b = (int(sys.stdin.readline().rstrip()) for i in range(3))

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


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

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



main()

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

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

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

Solution (Python):

def Buying_Sweeets(x , a , b):

    return (x - a) % b

def main():
    x = int(input())
    a = int(input())
    b = int(input())
    print(Buying_Sweeets(x , a , b))

if __name__ == '__main__':
    main()

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

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

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

print((x-a)%b)

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

print((x - a)%b)

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

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

Solution (Python):


N = int(input())
a = int(input())
b = int(input())

print((N-a) % b)

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

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

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

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

Solution (Python):

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

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

Solution (Python):
import math
import string


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


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


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

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

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

Solution (Python):
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()
y = (X - A)/B
x = X - A - y*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 i in range(3)]
print((x-a)%b)

Solution (Python):
a = [int(input()) for _ 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*((X-A)//B))

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

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

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

Solution (Python):



X,A,B = [int(input().strip()) for _ in range(3)]

num_B = (X-A) // B
ans = X - (A + num_B * B)

print(ans)

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

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

print((x - a) % b)

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

print((X - A) % B)

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

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

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

print((x - a) %  b)

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

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

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

re = X - A

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

print((X-A)%B)

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

print((n - a) % b)

Solution (Python):
x = 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())

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

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

Solution (Python):
def main():
    money_on_hand = int(input())
    cake_cost = int(input())
    donut_cost = int(input())
    print((money_on_hand - cake_cost) % donut_cost)


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

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())
d,m=divmod((x-a),b)
print(m)

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

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

Solution (Python):
print(eval(input()+"-"+input())%int(input()))

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

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

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

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

s = x - a
print(s%b)