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



Sample input:
1234
150
100


Sample output:
84

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

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

    print((x-a)%b)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

print((X-A)%B)

Submission status: Accepted

Solution code:
import sys
X = int(input())
A = int(input())
B = int(input())

if not ( 1 <= A <= 1000 and 1 <= B <= 1000):
    sys.exit()
if not (A + B <= X <= 10000):
    sys.exit()

print((X - A) % B )

Submission status: Accepted

Solution code:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

X = iIn()
A = iIn()
B = iIn()

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans=x-a

while ans>=b:
    ans=ans-b

print(ans)

Submission status: Accepted

Solution code:
x,a,b=map(int,open(0))
print((x-a)%b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print((X-A) % B)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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

print((x - a) % b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print((X-A) % B)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    X, A, B = list(int(input()) for i in range(3))

    print((X - A) % B)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(mod)

Submission status: Accepted

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

Submission status: Accepted

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


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

print(actual(x, a, b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

n = (x-a)//b

print(x-a- b*n)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

b_count = (x - a) // b

print(x - a - b * b_count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x=X-A
y=x%B

print(y)

Submission status: Accepted

Solution code:
# X
# A
# B
X = int(input())
A = int(input())
B = int(input())

print((X - A) % B)

Submission status: Accepted

Solution code:
lst = []
for _ in range(3):
    lst.append(int(input()))
print((lst[0]-lst[1]) % lst[2])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#from typing import List


def input_nums():
    # type: () -> List[int]
    return list(map(int, open(0)))


def calc_nums(l):
    # type: (List[int]) -> int
    x, a, b = l
    return (x - a) % b


def main():
    # type () -> None:
    print(calc_nums(input_nums()))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print((x-a) % b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 初期入力
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)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

num=(x-a)//b

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

Submission status: Accepted

Solution code:

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

X = X - A

print(X%B)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
# import time
# import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1             # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    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()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print((X - A)%B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: <encoding name> -*-

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

n = x - a
print(n % b)

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

Solution code:

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

print((x-a)%b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
X, A, B = map(int, open(0))
print((X - A) % B)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu May 14 01:01:31 2020

@author: shinba
"""

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

print((x-a)%b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

X = X - A
print(X % B)

Submission status: Accepted

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

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

Submission status: Accepted

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

x -= a
print(x%b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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()

Submission status: Accepted

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

c = x-a

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

print(c-b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X,A,B=int(input()),int(input()),int(input())
X-=A
while True:
    if X < B: break
    else: X-=B
print(X)

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

print((X-A) % B)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

print((X-A)%B)

Submission status: Accepted

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

d=int(yen)-int(cake)

m=d%int(donut)

print(m)

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

y = x - a
print(y%b)

Submission status: Accepted

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

a-=b
print(a%c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC087A

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

Submission status: Accepted

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

first = x - a
second = first % b

print(second)

Submission status: Accepted

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

X-=A
print(X%B)

Submission status: Accepted

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

money = x - a
rimining_money = money % b

print(rimining_money)

Submission status: Accepted

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

X -= A
mod = X % B

print(mod)

Submission status: Accepted

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

b = (X - A) // B

print(X-A-B*b)

Submission status: Accepted

Solution code:
n = int(input())
a = int(input())
b = int(input())
print(n - a - ((n - a) // b) * b) #(n - a) % b

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print((X - A) % B)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
#from collections import defaultdict
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 operator import itemgetter
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)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

X -= A

print(X - X // B * B)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
## io
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()))
## dp
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)]
## math
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()

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()

Submission status: Accepted

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

Submission status: Accepted

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

x -= a
while True:
    if x >= b:
        x -= b
    else:
        break

print(x)