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

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

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

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

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

ans=x-a

while ans>=b:
    ans=ans-b

print(ans)

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

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

zankin = int(X - A)


while zankin >= B:
    zankin = zankin - B
    count = count + 1
  

b = B * count

zankin2 = X - A - b

print(zankin2)

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

print((X-A) % B)

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

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

X = i()
A = i()
B = i()
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())
print((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 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()),int(input()),int(input())
dou=(x-a)//b
print(x-a-dou*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
print(x%b)

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

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

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

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

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

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

Solution (Python):
x,a,b=map(int,open(0));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 = map(int, open(0).read().split())
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):
def main():
    X, A, B = list(int(input()) 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):
print((int(input()) - int(input())) % int(input()))

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

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

Solution (Python):
dinheiro= int(input())
bolo= int(input())
cadadun= int(input())
eq= dinheiro-bolo
eq2= eq//cadadun
print(eq-(eq2*cadadun))

Solution (Python):
X=int(input())
A=int(input())
B=int(input())
check=(X-A)//B
ans=X-A-check*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)

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

print((x-a)%b)

Solution (Python):
import sys

input = sys.stdin.readline


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

    ans = (X - A) % B

    print(ans)


if __name__ == "__main__":
    main()

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

posess = X - A
syou = posess // B
mod = posess - syou * B

print(mod)

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

Solution (Python):
def actual(x, a, b):
    return (x - a) % b


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

print(actual(x, a, b))

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

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

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

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

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

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

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

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

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

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

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

b_count = (x - a) // b

print(x - a - b * b_count)

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

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

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

print(X-A-B*((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()), int(input()), int(input())
print((a-b)%c)

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

count_b = (x - a)//b
cash_out = a + b * count_b
cash_rest = x - cash_out

print(cash_rest)

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

x=X-A
y=x%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())
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):
lst = []
for _ in range(3):
    lst.append(int(input()))
print((lst[0]-lst[1]) % lst[2])

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

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

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



def input_nums():
    
    return list(map(int, open(0)))


def calc_nums(l):
    
    x, a, b = l
    return (x - a) % b


def main():
    
    print(calc_nums(input_nums()))


if __name__ == '__main__':
    main()

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

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

Solution (Python):
import sys
x=int(input())
a=int(input())
b=int(input())
x-=a
while(1):
    if x<b:
        print(x)
        sys.exit()
    else:
        x-=b

Solution (Python):
import sys
sys.setrecursionlimit(10**6)

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

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

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

for i in range(10**5):
  if nokori < b:
    print(nokori)
    exit()
  nokori -= 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):

import sys
input = sys.stdin.readline
X = int(input())
A = int(input())
B = int(input())
ans =X-A
num_b =ans//B
ans = ans - num_b *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-(x-a)//b*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=int(input())
a=int(input())
b=int(input())
print((x-a)%b)

Solution (Python):

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

num=(x-a)//b

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

Solution (Python):

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

X = X - A

print(X%B)

Solution (Python):


import sys






























def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    x = ii()
    a = ii()
    b = ii()
    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())

X=X-A

while True:
    X=X-B
    if X-B<0:
        break
    else:
        pass
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())
X -= int(input())
X %= int(input())
print(X)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

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

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

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

Solution (Python):
s = [int(input()) for _ in range(3)]
x, a, b = s[0], s[1], s[2]
if 1 <= a <= 1000 and 1 <= b <= 1000 and a + b <= x <= 10000:
    y = x - a
    z = y % b
    print(z)

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

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

print((X - A)%B)

Solution (Python):
import collections


def inputStrOnebyOne():
    s = list(input())
    return s


def inputOnebyOne_Int():
    a = list(int(x) for x in input().split())
    return a

def main():
    x = int(input())
    a = int(input())
    b = int(input())
    x = x-a
    while b <= x:
        x-=b
    print(x)
    
if __name__=='__main__':
    main()

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

print((x - a) % b)

Solution (Python):


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

n = x - a
print(n % b)

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

a -= b
a -= a // c * c

print(a)

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

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

Solution (Python):

X, A, B = map(int, open(0))
print((X - A) % B)

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

print((X - A) % B)

Solution (Python):

"""
Created on Thu May 14 01:01:31 2020

@author: shinba
"""

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

print((x-a)%b)

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

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

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

X = X - A
print(X % B)

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

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

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

x -= a
print(x%b)

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

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

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

c = x-a

while c-b >= b:
    c = c-b

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

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

Solution (Python):
def resolve():
	x, a, b = [int(input()) for _ in range(3)]
	v = (x - a) % b
	if v:
		print(v)
	else:
		print(0)
resolve()

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

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



if __name__ == '__main__':

    ABC_87_A()

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

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

Solution (Python):
num_list = [int(input()) for _ in range(3)]
X = num_list[0]
A = num_list[1]
B = num_list[2]
X -= A
while 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())

x -= a
print(x%b)

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

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

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

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

print((x-a)%b)

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

X = X - A

for i in range(100):
    if X - B >= 0:
        X = X - B

print(X)

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

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

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

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

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

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

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

Solution (Python):


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

print((X-A)%B)

Solution (Python):
yen=input()
cake=input()
donut=input()

d=int(yen)-int(cake)

m=d%int(donut)

print(m)

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

y = x - a
print(y%b)

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

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

Solution (Python):
n = input()
m = input()
l = input()

n = int(n)
m = int(m)
l = int(l)

n = n - m
while n >= l :
  n = n - l
else: 
  print(n)

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

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

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

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

first = x - a
second = first % b

print(second)

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

print((X-A)%B)

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

money = x - a
rimining_money = money % b

print(rimining_money)

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

X -= A
mod = X % B

print(mod)

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

b = (X - A) // B

print(X-A-B*b)

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

Solution (Python):
n = int(input())
a = int(input())
b = int(input())
print(n - a - ((n - 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):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

X = INT()
A = INT()
B = INT()

print((X-A)%B)

Solution (Python):
import math
x = int(input())
a = int(input())
b = int(input())
print(math.floor((x - a) % b))

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque

from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi

from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [LI()for i in range(n)]
inf = 10**17
mod = 10**9 + 7

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

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

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

s=a-b
t=s%c
print(t)

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

X -= A

print(X - X // B * 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):
import sys

IS = lambda: sys.stdin.readline().rstrip()
II = lambda: int(IS())
MII = lambda: list(map(int, IS().split()))
MIIZ = lambda: list(map(lambda x: x-1, MII()))

INIT_VAL = 0
DP2 = lambda d1, d2: [[INIT_VAL]*d2 for _ in range(d1)]
DP3 = lambda d1, d2, d3: [[[INIT_VAL]*d3 for _ in range(d2)] for _ in range(d1)]

DIVC = lambda x, y: -(-x//y)
DIVF = lambda x, y: x//y

def main():
    x = II(); a = II(); b = II()
    x -= a
    x -= (x//b)*b
    print(x)

if __name__ == '__main__':
    main()

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

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


if __name__ == '__main__':
    main()

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

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):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  

X = read_a_int()
A = read_a_int()
B = read_a_int()
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
q,r=divmod(x,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 -= A
ans = X - ((X//B) * B)
print(ans)

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

print((X-A) % B)

Solution (Python):
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations
import math
import bisect
import numpy as np
from collections import defaultdict, deque
from operator import itemgetter
from bisect import bisect_left, bisect_right
import sys
input = sys.stdin.readline





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

if __name__ == '__main__':
    main()

Solution (Python):
def main():
    import sys
    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())
ans = x - A
ans %= B
print(ans)