Harryxun/stf_run huggingface dataset:
A, B = map(int, input().split())

ans1 = int(A *100// 8) 
ans2 = int(B *100 // 10)

if ans1 = ans2:
    print(ans1)

elif ans1 > ans2:
    ans2_2 = int((B+1) *100 // 10)
    list = [int(ans2)]

    for i in range(ans2+1,ans2_2):
        list.append(int(i)) 
    
    if int(ans1) in list:
        print(ans1)
    else:
        print(-1)
elif ans1 < ans2:
    ans1_2 = int((A+1) *100 // 8)
    list = [int(ans1)]

    for i in range(ans1+1,ans1_2):
        list.append(int(i)) 
    
    if int(ans2) in list:
        print(ans2)
    else:
        print(-1)

### FIXED CODE ###

A, B = map(int, input().split())
ans1 = int(A *100// 8) 
ans2 = int(B *100 // 10)
ans1_2 = int((A+1) *100 // 8)
ans2_2 = int((B+1) *100 // 10)
list1 = []
list2 = []

for i in range(ans1,ans1_2):
    if int(i * 0.08) == A: 
        list1.append(int(i))
for j in range(ans2,ans2_2):
    if int(j * 0.1) == B:
        list2.append(int(j))
if list1[0] == list2[0]:
    print(list1[0])
elif list1[0] > list2[0]:
    if list1[0] in list2:
        print(list1[0])
    else:
        print(-1)
elif list1[0] < list2[0]:
    if list2[0] in list1:
        print(list2[0])
    else:
        print(-1)
a,b,c=(int(i) for i in input().split())
d=9
for i in range(0,d):
  c=a*c-b
  print(c)


### FIXED CODE ###

a,b=(int(i) for i in input().split())
if a<=5:
  print(0)
elif 5<a<=12:
  print(b//2)
else:
  print(b)
N = int(input())

AList = list(map(int, input().split()))

for i in range(0, N):
    for q in range(i, N):
        count += int(AList[i] ^ AList[q])
print(count % (10 ** 9 + 7))

### FIXED CODE ###

import numpy as np

mod = 10 ** 9 + 7

N = int(input())
 
AList = np.array(input().split(), dtype=np.int64)
count = 0
for i in range(60):
    Plus = np.count_nonzero(AList >> i & 1)
    count += 2 ** i * (Plus * (N - Plus))
print(count % mod)
N,K = list(map(int,input().split()))
TDlist = []

for x in range(0,N):
    TDlist.append(list(map(int,input().split())))

sorted_list = sorted(TDlist, key = lambda x: x[1], reverse=True)
kinds = []
seconds = []
answer = 0

for x in range(0,K):
    if not sorted_list[x][0] in kinds:
        kinds.append(sorted_list[x][0])
    else:
        seconds.append(sorted_list[x][1])
    answer += sorted_list[x][1]

answer += len(kinds)**2
score = answer
max_score = answer

for x in range(K,N):
    if seconds is []:
        break
    if sorted_list[x][0] in kinds:
        continue
    kinds.append(sorted_list[x][0])
    score += (sorted_list[x][1] - seconds[-1]) + (len(kinds)*2 -1)
    max_score = max(score,answer)
    seconds.pop()

answer = max(answer,max_score)

print(answer)

### FIXED CODE ###

N,K = list(map(int,input().split()))
TDlist = []

for x in range(0,N):
    TDlist.append(list(map(int,input().split())))

TDlist= sorted(TDlist, key = lambda x: x[1],reverse=True)
kinds = set()
seconds = []
answer = 0

for x in TDlist[:K]:
    if not x[0] in kinds:
        kinds.add(x[0])
    else:
        seconds.append(x[1])
    answer += x[1]

answer += len(kinds)**2
score = answer

for x in TDlist[K:]:
    if seconds == []:
        break
    if x[0] in kinds:
        continue
    kinds.add(x[0])
    y = seconds.pop()
    score += (x[1] - y) + (len(kinds)*2 -1)
    answer = max(score,answer)

print(answer)
N = int(input())
A = list(map(int, input().split()))

for i in range(N-1):
    for j in range(N-i):
        if A[i] == A[i+j+1]:
            print("NO")
            exit()

print("YES")

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()

for i in range(N-1):
    if A[i] == A[i+1]:
        print("NO")
        exit()

print("YES")
S=input()
if S=='ABC':
  print('ARC')
else:
  print('ABC)

### FIXED CODE ###

S=input()
if S=='ABC':
  print('ARC')
else:
  print('ABC')
import math

def make_divisors(n):
	divisors = []
	for i in range(1, int(n**0.5)+1):
		if n % i == 0:
			divisors.append(i)
			if i != n // i:
				divisors.append(n//i)
	return divisors

n = int(input())
print(make_divisors(math.factorial(n)) % (pow(10,9) + 7))

### FIXED CODE ###

import math
import collections

def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    #リストが空ならそれは素数
    factor.append(n)
    return factor

n = int(input())
c = collections.Counter([])
for num in range(2, n+1):
  prime_list = trial_division(num)
  c.update(prime_list)
res = 1
for prime, count in c.most_common():
  if(prime > 1):
    res = res * (count + 1)
print(res % (pow(10,9) + 7))
N = int(input())
candies_i = list(map(int, input().split()))
candies_j = list(map(int, input().split()))

l = []
count = 0

for i in range(N):
    count+=1
    total_li = sum(candies_i[:count])
    total_lj = sum(candies_j[+=1:])
    total = total_li + total_lj
    l.append(total)

print(max(l))


### FIXED CODE ###

N = int(input())
candies_i = list(map(int, input().split()))
candies_j = list(map(int, input().split()))

l = []

for i in range(N):
    total_li = sum(candies_i[:i+1])
    total_lj = sum(candies_j[i:])
    total = total_li + total_lj
    l.append(total)

print(max(l))
N, M = [int(i) for i in input().strip().split(' ')]

a = {}
b = {}
for i in range(M):
  X, Y, Z = [int(i) for i in input().strip().split(' ')]
  if X not in a:
    a[X] = set()
    b[X] = 0
  if Y not in a:
    a[Y] = set()
    b[Y] = 0

  a[X].add(Y)
  b[X] += 1
  a[Y].add(X)
  b[Y] += 1


def make_keys(keys, key):
  if key in keys:
    return
  keys.add(key)
  for k in a[key]:
    make_keys(keys, k)


counter = 0
# print(b)
for key, v in b:
  if key not in a:
    continue
  keys = set()
  make_keys(keys, key)

  for k in keys:
    if k in a:
      del a[k]

  counter += 1

print(counter + N - len(b))

### FIXED CODE ###

N, M = [int(i) for i in input().strip().split(' ')]

a = {}
for i in range(M):
  X, Y, _ = [int(i) for i in input().strip().split(' ')]
  if X not in a: a[X] = set()
  if Y not in a: a[Y] = set()
  a[X].add(Y)
  a[Y].add(X)

len_a = len(a)


def test(key_set):
  tmp = set()
  for key in key_set:
    if key in a:
      tmp = tmp.union(a[key])
      del a[key]

  #print('key_set = {}, tmp = {}'.format(key_set, tmp))
  return tmp


counter = 0
# print(b)

while len(a) > 0:
  #print('---')
  #print('a = {}'.format(a))
  key, key_set = a.popitem()
  #print('key = {}, key_set = {}'.format(key, key_set))
  tmp = test(key_set)
  while len(tmp) > 0:
    tmp = test(tmp)
  #print('a = {}'.format(a))
  counter += 1

print(counter + N - len_a)
import sys
sys.setrecursionlimit(10**6)

n,k=map(int,input().split())
a=list(map(int,input().split()))

if k==0:
    print(max(a))
    sys.exit()

def rf(mm):
    icnt=0
    for i in range(n):
        icnt+=(a[i]-1)//mm+1
    return icnt

asum=sum(a)
m=asum//(n+k)
um=asum
lm=1
for ii in range(60):
#    print(ii,um,lm,m)
    if rf(m)>(n+k):
        lm=m
        m=(um+lm)//2
    elif rf(m)<(n+k):
        um=m
        m=(lm+um)//2
    else:
        um=m-1
        m=(lm+um)//2
    if rf(m)==(n+k) and um-lm<5:
        break

for mi in range(m+5,m-10,-1):
#    print("mi",mi)
    if rf(mi)==(n+k) and rf(mi-1)>(n+k):
        break

print(mi)

### FIXED CODE ###

import sys

n,k=map(int,input().split())
a=list(map(int,input().split()))

if k==0:
    print(max(a))
    sys.exit()

def rf(mm):
    if mm==0:
        mm=1
    icnt=0
    for i in range(n):
        icnt+=(a[i]-1)//mm+1
    return icnt

asum=sum(a)
m=asum//(n+k)
um=asum
lm=1
for ii in range(60):
    if m==1:
        break
    if rf(m)<=(n+k) and rf(m-1)>(n+k):
        break
    if um-lm<5:
        break
    if rf(m)>(n+k):
        lm=m
        m=(um+lm)//2-1
    elif rf(m)<(n+k):
        um=m
        m=(um+lm)//2-1
    else:
        um=m-1
        m=(um+lm)//2-1
#    if rf(m)==(n+k) and um-lm<5:

if um<1:
    print(1)
    sys.exit()
    
for mi in range(um,max(0,lm-1),-1):
    if rf(mi)<=(n+k) and rf(mi-1)>(n+k):
        break

print(mi)
n,m = map(int,input().split())#nは品物の数　mは割引券の数
a = sorted(list(map(int,input().split())),reverse = True)#値段一覧
for i in range(m):
    if a[0] >= a[1]:
        a[0] = a[0]//2
        a.sort(reverse = True)
print(sum(a))

### FIXED CODE ###

import heapq
n,m = map(int,input().split())#nは品物の数　mは割引券の数
a = sorted(list(map(int,input().split())),reverse = True)#値段一覧
a = list(map(lambda x: x*(-1), a))  
heapq.heapify(a)#リストを優先度付きキューへ入れる
highest = 0
ans = []
for i in range(m):
    highest = heapq.heappop(a)*(-1)#heappopでとりだし　heappop(リスト名)*(リストのインデックス)本来最小値を取り出すものである
    heapq.heappush(a,highest//2*(-1))#引数(挿入先リスト名,挿入する数値)
print(sum(a)*-1)
#! -*- coding:utf-8 -*-

def search(values,hp,vp,fruit):
    if not (0<=hp<len(values)): return
    if not (0<=vp<len(values[hp])): return
    if fruit!=values[hp][vp]: return
    values[hp][vp]=0
    search(values,hp-1,vp,fruit)
    search(values,hp+1,vp,fruit)
    search(values,hp,vp-1,fruit)
    search(values,hp,vp+1,fruit)

def solve(values):
    count=0
    for i in range(len(values)):
        for j in range(len(values[i])):
            if values[i][j] in ['@','#','*']:
                search(values,i,j,values[i][j])
                count+=1
    return count

if __name__=='__main__':
    line=input()
    while line!='0 0':
        H,W = list(map(int,line.split(' ')))
        values = list()
        for _ in range(H):
            values.append([x for x in input().strip()])
        print(solve(values))

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**6)

def search(field,hp,vp,item):
	if not (0<=hp<len(field)): return
	if not (0<=vp<len(field[hp])): return
	if item!=field[hp][vp]: return
	field[hp][vp]=True
	for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]:
		search(field,hp+dh,vp+dv,item)
#	search(field,hp-1,vp,item)
#	search(field,hp+1,vp,item)
#	search(field,hp,vp-1,item)
#	search(field,hp,vp+1,item)

def solve(field):
	count,valid_items=0,set(['@','#','*'])
	for i in range(len(field)):
		for j in range(len(field[i])):
			if field[i][j] in valid_items:
				search(field,i,j,field[i][j])
				count+=1
	return count

def main():
	line = input().strip()
	while line!='0 0':
		H,W = list(map(int,line.split(' ')))
		field = list()
		for _ in range(H):
			field.append(list(input().strip()))
		print(solve(field))
		line = input().strip()

if __name__=='__main__':
	main()
n, k = map(int, input().split())
v = list(map(int, input().split()))
M = 0

for left in range(k + 1):
    for right in range(k - left + 1):
        if left + right > n:
            break
        hold = []
        hold.extend(v[:left])
        hold.extend(v[n-right:])
        hold.sort()
        total = sum(hold)
        for i in range(k - left - right):
            if 0 <= hold[i]:
                break
            total -= hold[i]
        M = max(M, total)

print(M)



### FIXED CODE ###

n, k = map(int, input().split())
v = list(map(int, input().split()))
M = 0

for left in range(k + 1):
    for right in range(k - left + 1):
        if left + right > n:
            break
        hold = []
        hold.extend(v[:left])
        hold.extend(v[n-right:])
        hold.sort()
        total = sum(hold)
        for i in range(min(k - left - right, left + right)):
            if 0 <= hold[i]:
                break
            total -= hold[i]
        M = max(M, total)

print(M)
N = int(input())
P = list(map(int, input().split()))

ans = 0

for i in range(n):
  if P[i] != i + 1:
    ans += 1
if ans <= 2:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

n = int(input())
p = list(map(int, input().split()))
z = 0
for i in range(n):
  if p[i] != i + 1:
    z += 1
if z <= 2:
  print('YES')
else:
  print('NO')
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect
import numpy as np

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

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

N = int(input())
A = LI()

count_list = [0 for i in range(61)]
def counts(count_list, a):
    for i in range(61):
        if a <= 0:
            break
        count_list[i] += a % 2
        a = a // 2
    return count_list

A.reverse()
ans = 0
ans_list = [0 for i in range(61)]
for i in range(N-1):
    count_list = counts(count_list, A[i])
    hikaku = counts([0 for i in range(61)], A[i + 1])
    for j in range(61):
        if hikaku[j] == 1:
            ans_list[j] += i+1 - count_list[j]
        else:
            ans_list[j] += count_list[j]

for i in range(61):
    ans += ans_list[i] * (2 ** i % mod)
    ans = ans % mod
print(ans)


### FIXED CODE ###

import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

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

N = int(input())
A = LI()

count_list = [0 for i in range(61)]
def counts(count_list, a):
    for i in range(61):
        if a <= 0:
            break
        count_list[i] += a % 2
        a = a // 2
    return count_list

A.reverse()
ans = 0
ans_list = [0 for i in range(61)]
for i in range(N-1):
    count_list = counts(count_list, A[i])
    hikaku = counts([0 for i in range(61)], A[i + 1])
    for j in range(61):
        if hikaku[j] == 1:
            ans_list[j] += i+1 - count_list[j]
        else:
            ans_list[j] += count_list[j]

for i in range(61):
    ans += ans_list[i] * (2 ** i % mod)
    ans = ans % mod
print(ans)
import math

def resolve():
	_ = int(input())
	a = list(map(int, input().split()))
	ans = math.inf
	for i in range(-100, 101):
		s = 0
		for j in a:
			s += (i-j)**2
		if ans > s:
			ans = s
	print(ans)
resolve()


### FIXED CODE ###

def resolve():
	n = int(input())
	ans = 1000000
	a = list(map(int, input().split()))
	for i in range(-100, 101):
		tmp = 0

		for j in a:
			tmp += (j-i)**2
		if tmp < ans:
			ans = tmp
	print(ans)

resolve()
h,w=map(int,input().split())

m=[input() for i in range(w)]


cnt=[[1000000 for i in range(h)] for j in range(w)]

print(cnt)
if m[0][0]=="#":
    cnt[0][0]=1
else:
    cnt[0][0]=0

for y in range(w):
    for x in range(h):
        if x>0:
            if m[y][x-1]=="." and m[y][x]=="#":
                cnt[y][x]=min(cnt[y][x],cnt[y][x-1]+1)
            else:
                cnt[y][x]=min(cnt[y][x],cnt[y][x-1])
        if y>0:
            if m[y-1][x]=="." and m[y][x]=="#":
                cnt[y][x]=min(cnt[y][x],cnt[y-1][x]+1)
            else:
                cnt[y][x]=min(cnt[y][x],cnt[y-1][x])


print(cnt[w-1][h-1])

### FIXED CODE ###

h,w=map(int,input().split())

m=[input() for i in range(h)]


cnt=[[1000000 for i in range(w)] for j in range(h)]

if m[0][0]=="#":
    cnt[0][0]=1
else:
    cnt[0][0]=0

for y in range(h):
    for x in range(w):
        if x>0:
            if m[y][x-1]=="." and m[y][x]=="#":
                cnt[y][x]=min(cnt[y][x],cnt[y][x-1]+1)
            else:
                cnt[y][x]=min(cnt[y][x],cnt[y][x-1])
        if y>0:
            if m[y-1][x]=="." and m[y][x]=="#":
                cnt[y][x]=min(cnt[y][x],cnt[y-1][x]+1)
            else:
                cnt[y][x]=min(cnt[y][x],cnt[y-1][x])


print(cnt[h-1][w-1])
#sを最高のパターンにして，tを最悪のパターンにすればいい
#continueで強制的に次のループへ
s = list(input())
t = list(input())

s.sort()
t.sort()
t.reverse()

if len(s)  == len(t):
    length =len(s)
    pattern == -1
elif len(s) < len(t):
    length = len(s)
    pattern = 0
else:#sのほうが長い時 pattern = 1
    length = len(t)
    pattern = 1

if pattern == -1:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] > t[i]:
            print("Yes")
            quit()
        else:
            print("No")
            quit()
elif pattern == 0:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] > t[i]:
            print("Yes")
            quit()
        else:
            print("No")
            quit()
    print("Yes")
elif pattern == 1:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] > t[i]:
            print("Yes")
            quit()
        else:
            print("No")
            quit()
    print("No")
        
    



### FIXED CODE ###

#sを最高のパターンにして，tを最悪のパターンにすればいい
#continueで強制的に次のループへ
s = list(input())
t = list(input())
condition = 0

s.sort()
t.sort()
t.reverse()

if len(s)  == len(t):
    length = len(s)
    pattern = -1
elif len(s) < len(t):
    length = len(s)
    pattern = 0
else:#sのほうが長い時 pattern = 1
    length = len(t)
    pattern = 1

if pattern == -1:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            print("Yes")
            condition =1
            break
        else:
            print("No")
            condition =1
            break
    if condition == 0:
        print("No")
elif pattern == 0:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            print("Yes")
            condition =1
            break
        else:
            print("No")
            condition =1
            break
    
    if condition == 0:
        print("Yes")
elif pattern == 1:
    for i in range(length):
        if s[i] == t[i]:
            continue
        elif s[i] < t[i]:
            print("Yes")
            condition =1
            break
        else:
            print("No")
            condition =1
            break
            
    if condition == 0:
        print("No")
N,K = map(int,input().split())
A = [int(i) for i in input().split()]
three_hold_list = [0] *(3*N)
ans = ans = [N] * N
if K >= N :
    print(*ans)
else:
    for i in range(K):
        Accum = [0] *(3*N)
        for j in range(N):
            Accum[N+j-A[j]] += 1
            Accum[N+j+A[j]+1] -= 1
        num = 0
        for l in range(3*N):
            num += Accum[l]
            three_hold_list[l] = num
        if three_hold_list[N:2*N] == ans:
            break
        else:
            A = three_hold_list[N:2*N]
    print(*three_hold_list[N:2*N])

### FIXED CODE ###

S  = input()
print(S[:3])
x = int(input())
y = int(input())

if x>y:
  print(int(2*x-1))
elif x<y:
  print(int(2*y-1))
elif x == y:
  print(int(x+y))

### FIXED CODE ###

x,y = map(int,input().split())
if x>y:
  print(int(2*x-1))
elif x<y:
  print(int(2*y-1))
elif x == y:
  print(int(x+y))
N = int(input())
L0 = 2
L1 = 1
for i in range(N-1):
  M = L0+L1
  L0 = L1
  L1 = M
print(M)

### FIXED CODE ###

L = [2,1]
for i in range(100):
  L.append(L[i+1]+L[i])
n = int(input())
print(L[n])
A,B,N=map(int,input().split())
s=math.floor((A*(B-1))/B))
t=math.floor((A*N)/B))
print(max(s,t))

### FIXED CODE ###

import math
A,B,N=map(int,input().split())
s=math.floor((A*(B-1))/B)
t=math.floor((A*N)/B)
print(min(s,t))
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)

    brr = []
 
    return brr

result = calculate(N, ARR, PRR)
print(max(result))



### FIXED CODE ###

n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))
N = int(input())
H = input().split()
l=0
for i in range(N):
  t_l=0
  for j in range(i, N-1):
    if H[j] >= H[j+1]:
      t_l = t_l + 1
    else:
      break
  if l < t_l:
    l = t_l
  i=j+1
print(l)


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
l=0
t_l = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    t_l = t_l + 1
    if l < t_l:
      l = t_l
  else:
    t_l=0
print(l)
x, a = map(int, input())
if a<=x:
  print(10)
else:
  print(0)

### FIXED CODE ###

x, a = map(int, input().split())
if a<=x:
  print(10)
else:
  print(0)
N = int(input())
temp = N
while temp > 0:
  test += temp %10
  temp //= 10
if N % test == 0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N = int(input())
temp = N
test = 0
while temp > 0:
  test += temp %10
  temp //= 10
if N % test == 0:
  print('Yes')
else:
  print('No')
S = input()
black = 0
count = 0
a = []

for i in range(len(S)):
  a.append(S[i])

for i in range(len(S)):
  if S[i] == "B":
    black += 1

def f(N, BW, black):
  if N == "B" or N =="W":
    return 0
  elif BW == "B":
    return f(N[1:], N[1], black - 1) + len(N) - black
  elif BW == "W":
    return f(N[1:], N[1], black)

print(f(S, S[0], black))

### FIXED CODE ###

S = input()
white = []
count = 0

for i in range(len(S)):
  if S[i] == "W":
    white.append(i)

for i in range(len(white)):
  count += white[i] - i

print(count)
N=int(input())
 
for N in 10000:
  if N % 1000 == 0：
  print(0)
else:
  sen = N//1000:
  sen2 = sen*1000
  atai = N-sen2
  print(atai)

### FIXED CODE ###

#! /usr/bin/python3

N = int(input())
1 <= N <= 10000

if N % 1000 == 0:
 print(0)
else:
  sen = N//1000
  sen2 = sen*1000
  atai = N-sen2
  atai2 = 1000-atai
  print(atai2)
import numpy as np
from bisect import *
n, m = map(int, input().split())
A, B, C = zip(*(map(int, input().split()) for _ in range(n)))
D, E, F = zip(*(map(int, input().split()) for _ in range(m)))
X = sorted(set(C + E + F))
Y = sorted(set(A + B + D))
H = len(X)-1
W = len(Y)-1
def TX(i):
    return bisect(X, i)-1
def TY(i):
    return bisect(Y, i)-1
U = np.ones((H+1, W))
for d, e, f in zip(D, E, F):
    d, e, f = TY(d), TX(e), TX(f)
    U[d, e:f] = False
L = np.ones((H, W+1))
for a ,b, c in zip(A, B, C):
    a, b, c = TY(a), TY(b), TX(c)
    L[a:b, c] = False
S = np.outer(np.diff(X), np.diff(Y)) 
i = bisect(Y, 0)-1
j = bisect(X, 0)-1
s = [(i,j)]
v = set()
r = 0
while s:
    i, j = s.pop()
    if (i,j) in v:
        continue
    v.add((i,j))
    if not (0<=i<H and 0<=j<W):
        print('INF')
        break
    r += S[i][j]
    if U[i][j]:
        s.append((i-1,j))
    if U[i+1][j]:
        s.append((i+1,j))
    if L[i][j]:
        s.append((i,j-1))
    if L[i][j+1]:
        s.append((i,j+1))
else:
    print(r)

### FIXED CODE ###

import numpy as np
from numba import njit
from bisect import *
n, m = map(int, input().split())
A, B, C = zip(*(map(int, input().split()) for _ in range(n)))
D, E, F = zip(*(map(int, input().split()) for _ in range(m)))
X = sorted(set(C))
Y = sorted(set(D))
H = len(Y)-1
W = len(X)-1
def TX(i):
    return bisect(X, i)-1
def TY(i):
    return bisect(Y, i)-1
U = np.ones((H+1, W))
for d, e, f in zip(D, E, F):
    #d, e, f = TY(d), TX(e), TX(f)
    d = TY(d)
    e = bisect_left(X, e)
    f = bisect_right(X, f)-1
    U[d, e:f] = False
L = np.ones((H, W+1))
for a ,b, c in zip(A, B, C):
    #a, b, c = TY(a), TY(b), TX(c)
    c = TX(c)
    a = bisect_left(Y, a)
    b = bisect_right(Y, b)-1
    L[a:b, c] = False
S = np.outer(np.diff(Y), np.diff(X))
@njit
def dfs(i, j):
    s = [(i,j)]
    v = np.zeros((H,W))
    r = 0
    while s:
        i, j = s.pop()
        if not (0<=i<H and 0<=j<W):
            return -1
        if v[i,j]:
            continue
        v[i,j] = True
        r += S[i,j]
        if U[i,j]:
            s.append((i-1,j))
        if U[i+1,j]:
            s.append((i+1,j))
        if L[i,j]:
            s.append((i,j-1))
        if L[i,j+1]:
            s.append((i,j+1))
    return r
r = dfs(TY(0), TX(0))
print('INF' if r<0 else r)
# n, k: 数値　s: 文字列　が与えられる
# k文字目を入れ替えよ

n, k = map(int, input().split())
s = input()

# dic = {"A":"a", "B":"b", "C":"c"}

# キーとなる文字　文字列のインデックスは0から
# s[k-1]


# 小文字にする表現がある 下記なら1発
print(s[:k-1] + s[k-i].lower() + s[k:])

# [開始インデックス:終了インデックス] 数値は　より大　と　未満
# print(s[:k-1] + dic.get(s[k-1]) + s[k-1:])

### FIXED CODE ###

n, k = map(int, input().split())
s = input()
print(s[:k-1] + s[k-1].lower() + s[k:])