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

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

Solution (Python):
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())
kosu = (X - A) // B
print(X - A - B * kosu)

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

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

Solution (Python):
import math

x = int(input())
a = int(input())
b = int(input())
print((x - a) - math.floor(((x - a) / 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())
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(x-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())

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

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

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

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

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

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

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

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    a, b, c = IR(3)
    a -= b
    print(a % c)
    return


def B():
    return


def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == '__main__':
    A()

Solution (Python):

import sys


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


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

ans = X - A
temp = ans // B
ans -= temp * B

print(ans)

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


if __name__ == '__main__':
	main()

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

Solution (Python):


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

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

Solution (Python):
from sys import stdin
X = int(stdin.readline().rstrip())
A = int(stdin.readline().rstrip())
B = int(stdin.readline().rstrip())

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

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

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

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

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

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

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

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

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

Solution (Python):
from sys import stdin
X,A,B = map(int, stdin.read().splitlines())
print( (X-A)%B )

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

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

print((x-a)%b)

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

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

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)]
b = a[0]-a[1]
c = a[2]
print(b-c*(b//c))

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

X -= A
while True:
    if X >= B:
        X -= B
    else:
        break

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

Solution (Python):

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

X -= A

print (X%B)

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

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

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

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

print((x - a) % b)

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

Solution (Python):
x=int(input())
a=int(input())
b=int(input())
for i in range(10000):
    if x-a<b*i:
        break
print(x-a-b*(i-1))

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

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

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

X = n()
A = n()
B = n()

print((X - A) % B)

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

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

Solution (Python):
x, a, b = map(int, (input(), input(), input()))
d = x - a
while d >= 0:
    d -= b
print(d + b)

Solution (Python):
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))


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

Solution (Python):
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    x, a, b = [int(input()) for i in range(3)]
    print((x - a) % b)

Solution (Python):
import sys

def input():
    return sys.stdin.readline().rstrip()

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

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

print((x - a) % b)

Solution (Python):


from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict
import math


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def mod_inv(x):
    
    global mod
    return pow(x, mod - 2, mod)


def gcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    ret = math.factorial(x)
    ret = ret // (math.factorial(x - y) * math.factorial(y))

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


class UnionFind:

    def __init__(self, n):
        self.parent = [i for i in range(n)]

    def root(self, i):
        if self.parent[i] == i:
            return i
        self.parent[i] = self.root(self.parent[i])
        return self.parent[i]

    def unite(self, i, j):
        rooti = self.root(i)
        rootj = self.root(j)
        if rooti == rootj:
            return
        if rooti < rootj:
            self.parent[rootj] = rooti
        else:
            self.parent[rooti] = rootj

    def same(self, i, j):
        return self.root(i) == self.root(j)





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

    x -= a
    print(x % b)


if __name__ == '__main__':
    main()

Solution (Python):

import sys


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



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


abc()

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

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

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

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

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

print((x - a) % b)

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

while res - b >= 0:
  res = res - b
print(res)

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

X -= A
print(X % B)

Solution (Python):


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

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

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

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

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

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

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

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

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

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

print((x - a) % b)

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

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):
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):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    

    
    

    
    
    
    
    
    
    
    
    
    INF = float("inf")

    
    MOD = 10**9+7
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

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

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

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

Solution (Python):










import numpy as np
import math
import copy

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

X = X - A
print(X%B)

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

Solution (Python):

import sys


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


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



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

    print((a - b) % c)




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

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

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

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

print((x-a)%b)

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

print((x-a) % b)

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

cost=x-a

answer=cost%b

print(answer)

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

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

print(ans)

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

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

print(int(ans))

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

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

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

Solution (Python):
import math
x=int(input())
a=int(input())
b=int(input())
d=x-a
c=math.floor(d/b)
print(d-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):

import sys
input = sys.stdin.readline

x = int(input())
a = int(input())
b = int(input())
x -= a
for i in range(1,10000):
    if x < b*i:
        print(x-b*(i-1))
        sys.exit()

Solution (Python):
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())
if x-a<b:
    print(x-a)
elif (x-a)>=b:
    c = (x-a)//b
    print(x-a-b*c)

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

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

print((x-a) % b)

Solution (Python):

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

X -= A

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

print(X)

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

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

ans = x - a
while True:
    if ans - b < 0:
        break
    else:
        ans = ans - b

print(ans)

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

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

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

ans = x - a
while True:
    if ans - b < 0:
        break
    else:
        ans = ans - b

print(ans)

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

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

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

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

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

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

Solution (Python):
import math
import sys


def input():
    return sys.stdin.readline()[:-1]








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

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

c = X - A
d = c % B
e = c - (d*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):
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 sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    x = f()[0]
    a = f()[0]
    b = f()[0]

    print((x-a)%b)

solve()

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

Solution (Python):
inLst = [0] * 3
for i in range(3):
    inLst[i] = int(input())

ans = inLst[0] - inLst[1]
ans = ans % inLst[2]
print(ans)

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

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

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

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

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

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

while tmp >= B:
  tmp=tmp-B
print(tmp)

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

Solution (Python):

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

    return x, a, b


def submit():
    x, a, b = read_input()

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

    print(t)

if __name__ == '__main__':
    submit()

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

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

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

m=x-a

print(int(m%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):
a=int(input())
s=int(input())
d=int(input())
print(a-s-(a-s)//d*d)

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

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

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

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

Solution (Python):



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

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

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

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

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

x -= a

print(x % b)

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

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

print((x - a) % b)

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

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

X -= A
print(X%B)

Solution (Python):
x = int(input())
a = int(input())
b = int(input())
n = (x-a) // b
if (x-a) % b == 0:
    print('0')
else:
    print(x - a - n*b)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
ans = 0
remain = X - A
for i in range(100000):
  if (remain - B) < 0:
    ans = remain
    break
  elif (remain - B) == 0:
    ans = 0
    break
  else:
    remain -= 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)]

x -= a

x -= x//b*b

print(x)

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

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

Solution (Python):
import functools

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


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


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper

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

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

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

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

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

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

print((X-A)%B)

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

print((x-a)%b)

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

Solution (Python):
x, a, b = eval("int(input())," * 3)
print((x - a) % b)

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

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