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

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

Solution (Python):

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

money = money - a

while True:
    if money >= b:
        money =  money - b
    else:
        break
print(money)

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

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 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 I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


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

    return (x-a) % b



print(main())

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

C = X - A

D = C % B

print(D)

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

Solution (Python):
"""
あなたは、X 円を持ってケーキとドーナツを買いに出かけました。
あなたはまずケーキ屋で 1 個 A 円のケーキを 1 個買いました。 次に、ドーナツ屋で 1 個 B 円のドーナツをできるだけたくさん買いました。
これらの買い物のあと手元に残っている金額は何円ですか。
"""

def buying_sweets(money,p_cake,p_dounuts):
    t_money  = money - p_cake
    c_dounuts = t_money // p_dounuts
    p_after_money = t_money - (c_dounuts * p_dounuts)
    return p_after_money

money = int(input())
p_cake = int(input())
p_dounuts = int(input())
print(buying_sweets(money,p_cake,p_dounuts))

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

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

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

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

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
Y = X - A
while Y >= B:
    Y = Y - B
print(Y)

Solution (Python):
X = int(input())
A = int(input())
B = int(input())
Y = X - A
while Y >= B:
    Y = Y-B
print (Y)

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

a = int(input())


money = x-a

b = int(input())
while money > 0:
    if((money - b ) >= 0):
        money -= b
    else:
        break
print(money)

Solution (Python):




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

X = X - A
for i in range(1,1000):
    if X < B:
        break
    else:
        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())
sub = x - a
while sub >= b:
    sub -= b
print(sub)

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

Solution (Python):
def calc(X, A, B):
    X -= A

    return X - X // B * B


if __name__ == '__main__':
    X = int(input())
    A = int(input())
    B = int(input())

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

y = (X - A) % B

print(y)

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

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


if __name__ == '__main__':
    main()

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

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

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

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

t = X - A
ans = t%B

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


print (ans)

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

print((x - a) %b)

Solution (Python):

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


if A<1 or A>1000:
    print("制約条件1<=A<=1000")
    raise ValueError
elif B<1 or B>1000:
    print("制約条件1<=B<=1000")
    raise ValueError
elif X<A+B or X>10000:
    print("制約条件A+B<=X<=10000")
    raise ValueError


residue = X-A


while(1):
    if residue-B >= 0:
        residue = residue-B
    else:
        break
    
    

print(residue)

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

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

Solution (Python):
total = int(input())
cake = int(input())
donut = int(input())
money = total - cake
while money >= donut:
    money = money - donut
print(money)

Solution (Python):
if __name__ == '__main__':
    x = int(input())
    a = int(input())
    b = int(input())
    if x <= a:
        print(0)
    else:
        print((x - a) % b)

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

Solution (Python):
X = int(raw_input())
A = int(raw_input())
B = int(raw_input())
X -= A
while X >= B:
    X -= B
print X

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

Solution (Python):


x=int(raw_input())
a=int(raw_input())
b=int(raw_input())

print (x-a)%b

Solution (Python):


import sys

x = int(raw_input().split()[0])
a = int(raw_input().split()[0])
b = int(raw_input().split()[0])

sys.stdout.write('%d\n' % ((x - a) % b))
sys.stdout.flush()

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

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

Solution (Python):

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

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

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

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

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

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

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

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

print((x - a) % b)

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

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

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



















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

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

print(X + B)

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
INF = float("inf")
import sys
sys.setrecursionlimit(10000)


def solve(X, A, B):
    X -= A
    n = X // B
    return X - n * B


def main():
    X = int(input())
    A = int(input())
    B = int(input())
    print(solve(X, A, B))


if __name__ == '__main__':
    main()

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

x -= a
x %= b

print(x)

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

print((X-A) % B)

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

print((x - a) % b)

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

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

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

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

Solution (Python):

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

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

Solution (Python):





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

Solution (Python):

"""
https://beta.atcoder.jp/contests/abc087/tasks/abc087_a

"""
import sys
from sys import stdin
input = stdin.readline


def solve(X, A, B):
    nokori = X - A
    return nokori % B


def main(args):
    X = int(input())
    A = int(input())
    B = int(input())
    ans = solve(X, A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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

print((X-A)%B)

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

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

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

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

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

Solution (Python):

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

Solution (Python):
money = int(input())
cake = int(input())
donut = int(input())

money = money - cake
surplus = money % donut
money = money - donut * surplus
print(surplus)

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

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

x_minus_a = x - a
ans = x_minus_a % b
print ans

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

Solution (Python):
from sys import stdin
a = int(stdin.readline())
b = int(stdin.readline())
c = int(stdin.readline())
print (a-b)%c

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

X -= A
print(X % B)

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

Solution (Python):


x = int(raw_input())
a = int(raw_input())
b = int(raw_input())

print str((x-a)%b)

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

print((X - A) % B)

Solution (Python):
import sys
x, a, b = map(int, sys.stdin.read().split("\n")[:3])
print((x-a) % b)

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

c=x-a
print(c%b)

Solution (Python):



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

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

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

x -= a
_, ans = divmod(x, 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 - (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):
total = int(input())
cake = int(input())
dounut = int(input())

answer = (total - cake) % dounut
print(answer)

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):
N = int(input())
A = int(input())
B = int(input())
p = N - A
ans = p - (p // B) * B
print(ans)

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

zankin = x - a
amari = zankin % b

print(amari)

Solution (Python):
input_lines = input()
int_x = int(input_lines)
input_lines2 = input()
int_a = int(input_lines2)
input_lines3 = input()
int_b = int(input_lines3)
int_x = int_x - int_a
while True:
	if int_x >= int_b:
		int_x = int_x - int_b
	else:
		break

print(int_x)

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

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

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

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

def main(): 
    argent = int(input())
    gateau = int(input())
    donut = int(input())
    print((argent-gateau)%donut)

main()

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

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

M = X-A

while True:
    if (M - B) >= 0:
        M = M - B
    else:
        break

print M

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

print(x%b)

Solution (Python):


from fractions import gcd
from math import factorial, ceil, sqrt, atan2, log
from itertools import *
import string
import copy
import random
import bisect
from decimal import *
def id_generator(size=20, chars=string.digits):
    return ''.join(random.choice(chars) for _ in range(size))
 
def mp():
    return map(int,str(raw_input()).split())

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

Solution (Python):
import sys
a = []
for line in sys.stdin:
    a.append(int(line))
q = a[0] - a[1]
p = q % a[2]
print(p)

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

Solution (Python):
if __name__ == "__main__":
  X = int(input())
  A = int(input())
  B = int(input())
  remain = X - A
  remain = remain % B
  print(remain)

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

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

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

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

Solution (Python):
money = int(input())
a = int(input())
b = int(input())
money -= a
while money >= b:
	money -= b

print(money)

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

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

pre_cash = X - A

while pre_cash >= B :
    pre_cash -= B

print pre_cash

Solution (Python):
money = int(input())
a = int(input())
b = int(input())
money -= a
while money >= b:
	money -= b

print(money)

Solution (Python):


if __name__ == '__main__':
    X = int(input())
    A = int(input())
    B = int(input())

    print((X - A) % B)

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

remain = x - a
b_cnt = remain // b
remain = remain - b * b_cnt

print(remain)

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

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

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

tmp = x - a
ans = tmp % b

print(ans)

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

x = x-A
n = x//B
print(x-n*B)

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

X -= A
X -= X // B * B

print(X)

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

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

print((X-A)%B)

Solution (Python):
have = int(input())
cake = int(input())
donutu = int(input())

have = have - cake

count = have // donutu
donutus = count * donutu
have = have - donutus

print(have)

Solution (Python):
if __name__ == '__main__':
    
    x = int(raw_input())
    a = int(raw_input())
    b = int(raw_input())
    
    print (x-a)%b

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

print((X - A) % B)

Solution (Python):
aa = int(input())
cake = int(input())
donut = int(input())

nokori = aa - cake
print(nokori%donut)

Solution (Python):

def solve():
    n = int(input())
    a = int(input())
    b = int(input())
    n -= a

    print(n % b)

solve()

Solution (Python):
import numpy as np

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

ans = x - a
ans = ans % b

print(ans)

Solution (Python):
def main():
    X, A, B = [int(input()) for _ in [0] * 3]

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

main()

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

x -= a

while x >= b:
    x -= b

print(x)

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

main()

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

S = X-A

ans = S % B
print(ans)

Solution (Python):
n = eval(input())
a = eval(input())
b = eval(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())

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

print(now)

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

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

coin = X - A

print(coin % B)

Solution (Python):

def solve():
  X = int(input())
  A = int(input())
  B = int(input())
  
  return str((X-A) % B)
 
if __name__ == '__main__':
  ans = solve()
  print(ans, flush=True)

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-(X-A)//B*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 = 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):
print( ( int(input()) - int(input()) ) % int(input()), end='')

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

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

Solution (Python):


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

y = x - a
z = y // b

print(y - b*z)

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

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

res = (x-y) % z

print(res)

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

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

print((x-a)%b)

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

print(X - A - B * count)

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

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

donus = (X - A) // B
res = X - A - B * donus
print(res)

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

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

x=x-a
x=x % b

print x

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

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

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

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

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

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


if __name__ == '__main__':
    main()

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

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

okane=x-a

while okane>=0:
    okane=okane-b

print(okane+b)

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

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

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

Solution (Python):

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

print (x - a) % b

Solution (Python):
def ketanowa(p):
    ans=0
    p=str(p)
    for i in p:
        ans+=int(i)
    return ans

def main():
    temp=input()
    n=int(temp)
    temp=input()
    a=int(temp)
    temp=input()
    b=int(temp)
    n=n-a
    k=int(n/b)
    n=n-b*k
    print(n)
    

if __name__ == '__main__':
    main()

Solution (Python):



import numpy as np

def slove(s, b):
    return s%b


if __name__ == "__main__":
    x = int(input())
    a = int(input())
    b = int(input())

    print(slove(x-a, b))

Solution (Python):

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

Solution (Python):
argent = int(input())
gateau = int(input())
donut = int(input())

argent -= gateau
argent %= donut
print(argent)

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

X -= A
ans = X % B

print ans

Solution (Python):
import collections
from pprint import pprint as pp

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

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

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

print((x-a)%b)

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

print((N - A) % B)

Solution (Python):



import sys

x = int(sys.stdin.readline().strip())
a = int(sys.stdin.readline().strip())
b = int(sys.stdin.readline().strip())

print((x - a) % b)

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

print((x-a)%b)

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

print((x-a)%b)

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

print((x-a)%b)

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

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

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


print((X - A) % B)

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

print((X-A)%B)

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

solve()

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

money -= int(input())

money %= int(input())

print(money)

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

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

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

print((X - A) % B)

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

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

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

x -= a
x %= b

print(x)