peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n = int(input())
ans = 1000-n%1000
if ans == 1000:
    ans = 0
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
import sys
import collections

sys.setrecursionlimit(10 ** 7)

# 1 ✕ 1 (int)
K = int(input().rstrip())

# 1 ✕ 1 (str)
S = input().rstrip()

if len(S) > K:
    print(S[:K] + "...")
else:
    print(S)
# Judge status: Wrong Answer
input_list = []
for i in range(0, 3):
  input_list.append(int(input()))

h = input_list[0]
w = input_list[1]
n = input_list[2]

temp_num = 0
if w <= h:
  temp_num = h
else:
  temp_num = w

answer = 0
if n % temp_num == 0:
  answer = n / temp_num
else:
  answer = (n // temp_num) + 1
# Judge status: Accepted
n, k=map(int, input().split())
ans=0
for i in range(1, n+1):
    cnt=0
    p=i

    while p<k:
        p*=2
        cnt+=1
    
    ans+=(1/2)**cnt

print(ans*(1/n))
# Judge status: Accepted
primes = [2]

X = int(input())


def is_prime(n):
    for p in primes:
        if n < p * p:
            break
        if n % p == 0:
            return False
    return True


for i in range(3, X, 2):
    if is_prime(i):
        primes.append(i)

while True:
    if is_prime(X):
        print(X)
        break
    X += 1
# Judge status: Wrong Answer
line=input()
n,k=map(int,line.split())
sums=0
while k!=(n+2):
     if k==1:
          mini=1
     if k>=2:
          mini=(((k)*(k-1))/2)%((10**9)+7)
     maxi=( (((n+1)*(n)) - ((n+1-k)*(n-k)) )/2  )%((10**9)+7)
     sums+=(maxi-mini+1)
     sums=sums%((10**9)+7)
     k+=1
print(int(sums))
# Judge status: Wrong Answer
N = int(input())
C = [0]*N
S = [0]*N
F = [0]*N
T = [0]*N
 
for i in range(N-1):
  C[i], S[i], F[i] = map(int, input().split())

for j in range(N-1):
  T[j] = C[j] + S[j]
  for i in range(j, N-1):
    if T[j] >= S[i+1] or S[i+1] == 0:
      T[j] = T[j] + C[i+1]
    elif T[j] < S[i+1]:
      T[j] = S[i+1]

T[N-1] = 0
for i in range(N):
  print(T[i])
# Judge status: Wrong Answer
str = input()
if str.isupper()=="TRUE":
  print("A")
else:
  print("a")
# Judge status: Accepted
A, B, N = map(int, input().split())

if N < B:
    print((A * N)//B)
else:
    x = (N // B) * B - 1
    print((A*x)//B - A*(x//B))
# Judge status: Accepted
n,*a=map(int,open(0).read().split())
from fractions import gcd
from functools import reduce
print(reduce(gcd,a))
# Judge status: Accepted
#!/usr/bin/env python3
n, m = map(int, input().split())
for i in reversed(range(1,m//n+1)):
    if m%i<1:
        print(i)
        exit()
# Judge status: Wrong Answer
a,b = map(int,input().split())

if a%3 == 0 or b%3 == 0 or (a+b)%3 == 0:
  print("possible")
else:
  print("impossible")
# Judge status: Accepted
import sys


input = sys.stdin.readline


def main():
    m = N % 10
    if m in [2, 4, 5, 7, 9]:
        print("hon")
    elif m in [0, 1, 6, 8]:
        print("pon")
    else:
        print("bon")


if __name__ == "__main__":
    N = int(input())
    main()
# Judge status: Accepted
n = input()

remainder = [0]*2019
remainder[0] += 1
x = 1
rem = 0

for i in range(1, len(n)+1):
	rem = (rem + int(n[-i])*x)%2019
	remainder[rem] += 1
	x *= 10
	x %= 2019
    
res = 0
for e in remainder:
	res += e*(e-1)//2

print(res)
# Judge status: Accepted
X,Y = map(int,input().split())
n = 0
ans = 0
while True:
  tmp = X * (2**n)
  if(tmp > Y):
    break
  else:
    ans += 1
    n += 1
print(str(ans))
# Judge status: Accepted
a,b,x = map(int,input().split())
if a <= x <= a+b:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
def divisor(n):
    d = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            d.append(i)
            if i ** 2 == n:
                continue
            d.append(n // i)
    return d

n = int(input())
A = list(map(int, input().split()))

dup = [x for x in set(A) if A.count(x) > 1]
A_dif = set(A) - set(dup)

cnt = 0
for a in A_dif:
    tmp = set(divisor(a)) & set(A_dif)
    if len(tmp) == 1: cnt += 1

print(cnt)
# Judge status: Accepted
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
x.append(X)
y.append(Y)
x.sort()
y.sort()

if x[-1]<y[0]:
    print('No War')
else:
    print('War')
# Judge status: Wrong Answer
A=input()
x=A[-1]
if x==3:
	print('bon')
elif x==0 or 1 or 6 or 8:
	print('pon')
else:
	print('hon')
# Judge status: Accepted
K  = int(input())
a = 0

for i in range(K):
    a = (10 * a + 7) % K
    if a % K == 0:
        print(i+1)
        exit()
    else:
        a %= K

print(-1)
# Judge status: Wrong Answer
n,k = map(int, input().split())
L = list(map(int,input().split()))
ans = 0
S = sorted(L)
print(S)
for i in range(n):
    if k > 0:
        del S[-1]
        k = k-1
print(S)
print(sum(S))
# Judge status: Wrong Answer
A=list(map(int,input().split()))
A.sort
#print(A)
if A==[5,5,7]:
  print('YES')
else:
  print('NO')
# Judge status: Wrong Answer
# 2020/03/14
# AtCoder Beginner Contest 086 - C

# Input
n = int(input())
nx = 0
ny = 0
nt = 0

# Check
ans = "Yes"
for i in range(n):
    t, x, y = map(int,input().split())
    dist = abs(nx - x) + abs(ny - y)
    if dist > (t - nt) or (dist <= (t - nt) and dist % 2 == 0):
        ans = "No"
        break
    nx = x
    ny = y
    nt = t

# Output
print(ans)
# Judge status: Accepted
import math
a, b, n = list(map(int, input().split(" ")))
k = min(b - 1, n)
print(int(math.floor(a * k / b) - a * math.floor(k / b)))
# Judge status: Wrong Answer
N,K=map(int,input().split())
cnt=0
for k in range(K,N+2):
    MIN=k*(k-1)//2
    MAX=(2*N-k+1)*k//2
    cnt+=MAX-MIN+1
print(cnt)
# Judge status: Wrong Answer
def main():
    _ = int(input())
    B = list(map(int, input().split()))
    A = []
    A.append(min(B[0:2]))
    A.append(min(B[0:2]))

    for i in range(1, len(B[:-1])):
        A.append(min(B[i], B[i+1]))
    if len(B) > 1:
        A.append(B[-1])

    print(sum(A))

    
if __name__ == '__main__':
    main()
# Judge status: Accepted
n, m = map(int, input().split())
T = []
A = [str(0) for _ in range(n)]
for i in range(m):
  s, t = map(int, input().split())
  T.append([s, t])
f = True
for i in range(m):
  for j in range(i, m):
    if (T[i][0] == T[j][0] and T[i][1] != T[j][1]) or (T[i][0] == 1 and T[i][1] == 0 and n > 1):
      f = False
      break
  A[T[i][0]-1] = str(T[i][1])
if n == 1 and m == 0:
  print(0)
  exit()
elif A[0] == "0" and len(A) > 1:
  A[0] = "1"
if f: print("".join(A))
else: print(-1)
# Judge status: Wrong Answer
K,X=input().split()
if(int(K)*500>int(X)):
  print("Yes")
else:
  print("No")
# Judge status: Accepted

a, b, c = map(int, input().split())
print(max(a, b, c) * 10 + a + b + c - max(a, b, c))
# Judge status: Wrong Answer
a,b=map(int,input().split())
print("Possible" if (a+b)%3==0 else "Impossible")
# Judge status: Accepted
n = int(input())
if n % 9 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
h, a=map(int,input().split())
if h%a == 0:
    count=h//a
else:
    count = h//a+1
print(count)
# Judge status: Accepted
S = input()
if 1 <= int(S[:2]) <= 12 and 1 <= int(S[2:]) <= 12:
    print("AMBIGUOUS")
elif 1 <= int(S[2:]) <= 12:
    print("YYMM")
elif 1 <= int(S[:2]) <= 12:
    print("MMYY")
else:
    print("NA")
# Judge status: Accepted
N = int(input())
A = [list(map(int,input().split())) for _ in range(N)]
B = sorted([[A[i][0]-A[i][1],A[i][0]+A[i][1]] for i in range(N)],key=lambda x:x[1])
cur = 1
C = [B[0]]
while cur<N:
    if B[cur][0]>=C[-1][1]:
        C.append(B[cur])
    cur += 1
print(len(C))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7

all_item = sum(a)

ans = 0
for i in range(n):
    all_item = (all_item - a[i])%mod
    ans = (ans + all_item*a[i])%mod
print(ans)
# Judge status: Accepted
n=input().split()
print("YES" if n.count("5")==2 and n.count("7")==1 else "NO")
# Judge status: Wrong Answer
l = list(input().split())
a = ["1","3","5","7","8","10","12"]
b = ["4","6","9","11"]
c = ["2"]
if a >= l or b >= l:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
import heapq
n,k = map(int,input().split())
a = list(map(int,input().split()))
r = [0 for _ in range(max(a)+1)]
if len(set(a)) <= k:
    print(0)
    exit()
for i in range(n):
    r[a[i]] += 1
t = []
for i in range(len(r)):
    if r[i]:
        t.append(r[i])
t = list(map(lambda x:-x,t))
heapq.heapify(t)
print(n+sum(t[:k]))
# Judge status: Accepted
n = int(input())
x = ''
while n != 0:
    if n % (-2) == 0:
        n //= (-2)
        x = '0' + x
    else:
        n = (n - 1) // (-2)
        x = '1' + x
print(x if x else 0)
# Judge status: Accepted
a = int(input())
s = input()

if a>=3200:
  print(s)
else:
  print('red')
# Judge status: Accepted
D = int(input())

if D==25:
  print('Christmas') 
if D==24:
  print('Christmas Eve') 
if D==23:
  print('Christmas Eve Eve') 
if D==22:
  print('Christmas Eve Eve Eve')
# Judge status: Accepted
N = int(input())
s = {}
for _ in range(N):
    input_s = list(input())
    input_s = sorted(input_s)
    input_s = "".join(input_s)
    if input_s not in s.keys():
        s[input_s] = 0
    s[input_s] += 1
ans = 0
for key, value in s.items():
    if value >= 2:
        ans += value * (value - 1) // 2
print(ans)
# Judge status: Wrong Answer
n,m=map(int,input().split())
dic={}
doll=0
for i in range(n):
  a,b=map(int,input().split())
  dic[a]=b
  
con=sorted(dic.items())
for k,v in con:
  if v<m:
    doll+=k*v
    m-=v
  else:
    doll+=k*m
    print(doll)
    exit()
# Judge status: Accepted
from functools import lru_cache

@lru_cache(maxsize=None)
def luca(x):
    if x==0:
        return 2
    if x==1:
        return 1
    
    return luca(x-1)+luca(x-2)
    
print(luca(int(input())))
# Judge status: Wrong Answer
a,b = map(float, input().split())
print(int(a*b))
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))

box = [0 for _ in range(N)]

for i in reversed(range(N)):
    if a[i] == 1:
        box[i] = 1

temp = sum(box)
if temp % 2 != a[0]:
    print(-1)
    exit()

for i in range(1, N):
    temp = sum(box[i:i+1])
    if temp % 2 == a[i]:
        continue
    else:
        print(-1)
        exit()

print(sum(box))
for n, i in enumerate(box):
    if i == 1:
        print(n+1, end="")
    else:
        print(end="")
# Judge status: Accepted
import numpy as np

n = int(input())
A = list(map(int,input().split()))

cnt = np.sum(np.where(np.array(A) < 0, True, False))

#print(cnt)

A = list(map(lambda x:abs(x), A))


if cnt%2 == 0:
    print(sum(A))
else:
    print(sum(A)-2*min(A))
# Judge status: Accepted
def main():
    n = int(input())
    a = list(map(int, input().split()))

    if 0 in a:
        print(0)
        return

    res = 1
    for e in a:
        res *= e
        if res > 10**18:
            print(-1)
            return

    print(res)

main()
# Judge status: Wrong Answer
x = int(input())
print((360 -1)  // x + 1)
# Judge status: Wrong Answer
s=input()
k="keyence"
t=""
for i in range(7):
  if k[i]!=s[i]:
    t+=k[:i]
    break
else:
  print("YES")
  exit()
for j in range(7-i):
  if k[-j-1]!=s[-j-1]:
    t+=k[7-j:]
    break
print("YES" if t==k else "NO")
# Judge status: Wrong Answer
N = int(input())
A = list(input().split())

edge_list =  []
selection = sorted(list(set(A)))[::-1]

for i in selection:
    edge_list += i * (A.count(i) // 2)
    if len(edge_list) >= 2:
        break
edge_list.sort()

if len(edge_list) < 2:
    print(0)
else:
    print(int(edge_list[-1]) * int(edge_list[-2]))
# Judge status: Accepted
N,K = map(int,input().split())

print(min(N%K,K-N%K))
# Judge status: Wrong Answer
# A
n, k = map(int, input().split())
s = list(input())

s[n-1] = s[n-1].lower()
for i in s:
    print(i, end ="")
# Judge status: Wrong Answer
x = input().split()
a = int(x[0])
b = int(x[1])
c = int(x[2])

if c % 2 == 0:
    c1 = c / 2
    a = a - c1
    b = a - c1
    if (a < 0):
        a = 0
    if (b < 0):
        b = 0
else:
    c = c - 1
    c1 = c / 2
    c1 = c1 + 1
    a = a - c1
    b = b - c1
    b = b + 1
    if a < 0:
        a = 0
    if b < 0:
        b = 0

print("{} {}".format(int(a), int(b)))
# Judge status: Accepted
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

S = input()
if all(c != 'R' for c in S[1::2]) and all(c != 'L' for c in S[::2]):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N = int(input())
X = list(map(int,input().split()))

import numpy as np
arr = np.array(X)

ans = np.inf
for i in range(1,101):
    ans = min(ans, sum(map(lambda x:x**2,arr-i)))

print(ans)
# Judge status: Accepted
n = int(input())
if n%1000 == 0:
    change = 0
else:  
    change = (1000*(n//1000 + 1)) - n
print(change)
# Judge status: Accepted
S=input()
n=0
for i in S:
    if (n%2==0 and i=="L") or (n%2==1 and i=="R"):
        print('No')
        exit()
    n+=1

print('Yes')
# Judge status: Wrong Answer
S = input()

ans = [0] * (len(S) + 1)
for i in range(len(S)):
    if S[i] == '<':
        ans[i + 1] = ans[i] + 1

print(ans)

for i in range(len(S)-1, -1, -1):
    if S[i] == '>':
        ans[i] = max(ans[i + 1] + 1, ans[i])
print(ans)
print(sum(ans))
# Judge status: Accepted
l  = [int(x) for x in input().split()]
if l[0]==l[1]:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import math
n=int(input())
num=int(math.sqrt(n*2))
num2=(num*(num+1))//2
num3=n-num2
if num3>num:
    num+=1
    num3-=num
ans=list(range(1,num+1))
for i in range(num-num3,num):
    ans[i]+=1
for i in ans:
    print(i)
# Judge status: Accepted
c = []
for _ in range(3):
  c.append(list(map(int, input().split())))
if c[0][1]-c[0][0] == c[1][1]-c[1][0] and c[2][1]-c[2][0] == c[1][1]-c[1][0] and c[0][2]-c[0][1] == c[1][2]-c[1][1] and c[2][2]-c[2][1] == c[1][2]-c[1][1]:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
A,B,X = map(int,input().split())

if X>A+B or A>X:
  print('No')
else:
  print('Yes')
# Judge status: Wrong Answer
n = int(input())

l0 = 2
l1 = 1
l2 = 0
for i in range(n-1):
    l2 = l0 + l1
    l0, l1 = l1, l2

print(l2)
# Judge status: Accepted
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
#import numpy as np
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
#N = int(input())
#S = str(input())

K, X = map(int, input().split())
rmin = -1* (10 ** 6)
rmax = (10 ** 6)

lmin = max(rmin, X-K+1)
lmax = min(rmax, X+K-1)

ans = str(lmin)
for i in range(lmin+1, lmax+1) :
  ans += " " + str(i)

print (ans)
# Judge status: Wrong Answer
n = int(input())
MAXN = 110000

f_inf = float('inf')
dp = [f_inf] * (MAXN+n)

dp[0] = 0

for i in range(1, n+2):
    for j in range(5):
        dp[i] = min(dp[i], dp[i-pow(6, j)]+1)
    for k in range(5):
        dp[i] = min(dp[i], dp[i-pow(9, k)]+1)

print(dp[n])
# Judge status: Accepted
S = input()
T = input()
S = S + S

for i in range(0, len(S) - len(T)+1):
    if S[i: i + len(T)] == T:
        print("Yes")
        exit()

print("No")
# Judge status: Wrong Answer
a,b,c,d=map(int, input().split())
if b<c or d<a:
  print(0)
elif b>=c:
  print(b-c)
else:
  print(d-a)
# Judge status: Accepted
a = input()
print("Yes" if a[0]==a[1]==a[2] or a[1]==a[2]==a[3] else "No")
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
if abs(b-a)<=d and abs(c-b) <=d:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

ans,ov = 0,0

for i in range(N):
    tmp = min(A[i],ov)
    ans += tmp
    A[i] -= tmp
    if B[i]>A[i]:
        ans+=A[i]
        ov = B[i]-A[i]
    else:
        ans+=B[i]
        ov = 0
tmp = min(A[N],ov)
ans+=tmp
print(ans)
# Judge status: Accepted
w=input()
ans="Yes"
w_len=len(w)
if w_len%2==1:
    ans="No"
else:
    for i in range(w_len):
        w_i=w[i]
        w_count=w.count(w_i)
        if w_count%2==1:
            ans="No"
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

Alice = 0
Bob = 0
A.sort(reverse=True)
for i in range(len(A)):
    if i%2 == 0:
        Alice += A[i]
    else:
        Bob += A[i]
    
print(Alice-Bob)
# Judge status: Accepted
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
from collections import Counter, deque, defaultdict

N = int(input())
S = input()

mi = 10000000

c = Counter(S)
A = N - c["#"]
B = N - c["."]

l = 0
r = c["."]

for i in range(0, N):

    if S[i] == "#":
        l += 1
    else:
        r -= 1
    a = l + r
    if mi > a:
        mi = a

print(min(mi, A, B))
# Judge status: Accepted
N = int(input())
W = []
for i in range(N):
  w = input()

  if len(W) == 0 or (W.count(w) == 0 and l == w[0]):
    W.append(w)
    l = w[-1]
  else:
    print("No")
    exit()    

print("Yes")
# Judge status: Accepted
N, K = [int(i) for i in input().split()]
R, S, P = [int(i) for i in input().split()]
d = {'r': P, 's': R, 'p': S}
T = input()
checked = [False for i in range(N)]
# 勝てるだけ勝てばいい
for i in range(N-K):
    if T[i] == T[i+K]:
        if checked[i] == False:
            checked[i+K] = True
result = 0
for i in range(N):
    if checked[i] == False:
        result += d[T[i]]
print(result)
# Judge status: Wrong Answer
d=int(input())
result='Christamas'
n=25
while n>=22:
    if n>d:
        result+=' Eve'
    n-=1
print(result)
# Judge status: Wrong Answer
N = int(input())
L = list(map(int,input().split()))
b2 = 0
b4 = 0

for i in range(N):
    if L[i] % 4 == 0:
        b4 += 1
    elif L[i] % 2 == 0:
        b2 += 1
other = N-b4-b2

if other//2 > b4:
    print('No')
else:
    rb4 = b4-(other//2)
    if b2 % 2 == 1:
        if rb4 == 0:
            print('No')
        else:
            print('Yes')
    else:
        print('Yes')
# Judge status: Accepted
import re
print(max(map(len, re.findall("[ACGT]*", input()))))
# Judge status: Wrong Answer
from math import ceil
N,H=map(int,input().split())
AB=[list(map(int,input().split())) for i in range(N)]
sw=max(AB[i][0] for i in range(N))
cnt=0
for i in range(N):
    if AB[i][1]>=sw:
        cnt+=1
        H-=AB[i][1]
        if(H<=0):
            print(cnt)
            exit()
cnt+=ceil(H/sw)
print(cnt)
# Judge status: Wrong Answer
N = int(raw_input())
S = raw_input()

state = 0
count = 0
#print S
#print len(S)
for i in range(len(S)):
    if S[i] == 'A':
        state = 1
    elif state == 1 and S[i] == 'B':
        state = 2
    elif state == 2 and S[i] == 'C':
        count += 1; state = 0
    else:
        state = 0
print count
# Judge status: Wrong Answer
# スペース区切りの文字列の入力
KN = input().split()
A = input().split()

i  = ans = 0
max = 0

for i in range(int(KN[1])):
  if(i == int(KN[1]) - 1):
    A2 = int(KN[0])
  else:
    A2 = int(A[i+1])
    
  # 距離が最大のもの以外をansに加算
  if(max < abs(A2 - int(A[i]))):
      ans += max
      max = abs(A2 - int(A[i]))
  else:
    ans += abs(A2 - int(A[i]))
print(ans)
# Judge status: Wrong Answer
import sys
from collections import Counter

input = sys.stdin.readline

N = int(input())
ans = 1
mod = 998244353
D = sorted(Counter(list(map(int, input().split()))).items())
tmp = D[0][1]
stream = 0
for n, i in D:
    if stream != n:
        exit()
    if n == 0:
        stream += 1
        continue
    ans *= pow(tmp, i)
    ans %= mod
    tmp = i
    stream += 1
print(ans)
# Judge status: Accepted
n = input()
if (n[0]==n[1] and n[1]==n[2]) or (n[2]==n[3] and n[1]==n[2]):
    print("Yes")
else:
    print("No")
# Judge status: Accepted

INF = 2**31-1
n,k = map(int,input().split())
h = list(map(int,input().split()))
dp = [INF for _ in range(n)]

dp[0] = 0

for i in range(0,n):
    for j in range(1,k+1):
        if i+j < n:
            dp[i+j] = min(dp[i+j], abs(h[i+j] - h[i]) + dp[i])
        else: break

print(dp[n-1])
# Judge status: Accepted
N = int(input())
C = list(input())

RC = C.count("R")
WC = C.count("W")

print(C[:RC].count("W"))
# Judge status: Wrong Answer
import math
N,L = map(int,input().split())
r = []
total=0
ap=0
max = -100100100100
for i in range(1,N+1):
  r.append(L+i-1)
for i in range(N):
  for j in range(N):
    if j != i:
      total+=r[j]
  if max < total:
    ap = total
  total=0
print(ap)
# Judge status: Accepted
S = input()
print(S.replace("2017", "2018"))
# Judge status: Accepted
a, b, c = map(int, input().split())
for i in range(b):
    if i * a % b == c:
        print("YES")
        exit()
print("NO")
# Judge status: Accepted
import copy
N = int(input())
X = [int(i) for i in input().split()]
Y = copy.deepcopy(X)
Y = sorted(Y, key= lambda x: -x)

c = int(N/2)

for i in range(N):
    a = X[i]
    if a >= Y[c-1]:
        print(Y[c])
    else:
        print(Y[c-1])
# Judge status: Wrong Answer
S=input()
N=len(S)
A=[int(i) for i in S]
D=["+" for i in range(N-1)]
output=S[0]
for i in range(2**N):
  C=A
  B=D
  for j in range(N-1):
    if ((i>>j)&1):
      C[j+1]= -1*int(str(S[j+1]))
      B[j]=  "-"
    else:
      C[j+1]= int(str(S[j+1]))
      B[j]=  "+"
  print(C,B,sum(C))
  if sum(C) ==7:
    for i in range(1,N):
      output += B[i-1] + str(S[i])
    print(output+"=7")
    break
# Judge status: Accepted
sx, sy, tx, ty = map(int, input().split())

res = []
for i in range(abs(ty - sy)):
    res.append("U")
for i in range(abs(tx - sx)):
    res.append("R")
for i in range(abs(sy - ty)):
    res.append("D")
for i in range(abs(tx - sx) + 1):
    res.append("L")
for i in range(abs(ty - sy) + 1):
    res.append("U")
for i in range(abs(tx - sx) + 1):
    res.append("R")
res.append("D")
res.append("R")
for i in range(abs(ty - sy) + 1):
    res.append("D")
for i in range(abs(tx - sx) + 1):
    res.append("L")
res.append("U")
print("".join(res))
# Judge status: Wrong Answer
import math
A, B = map(float, input().split())
lowerA = math.ceil(A/0.08)
upperA = math.floor((A+1)/0.08)      
lowerB = math.ceil(B/0.1)
upperB = math.floor((B+1)/0.1)
answer = -1
for i in range(lowerA, upperA):
  if (lowerB <= i) and (i <= upperB):
    answer = i
    break
print(answer)
# Judge status: Accepted
stack =[]

s = input()

for i in s:
	if i != "B":
		stack.append(i)
	else:
		if stack:
			stack.pop()


print("".join(stack))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))

from collections import Counter

z = Counter(a)

i,j,temp = (0,0,0)
for tu in z.items():
    i,j = tu
    if i>j:
        temp+=j
    elif i<j:
        temp+=j-i
    else:
        continue

print(temp)
# Judge status: Accepted
n = int(input())

print(-(-n//111)*111)
# Judge status: Wrong Answer
x = int(input())
money = 100
year = 0
while True:
  money = money + money*0.01
  money = money // 1
  year += 1
  if money >= x:
    print(year)
    exit()
# Judge status: Wrong Answer
if __name__ == "__main__":
  inNum = int(input())
  intArr = []


  while(inNum > 0):
      tempNum =int(input())
      intArr.append(tempNum)
      inNum = inNum-1

  intArr
  sortArr = intArr
  sortArr.sort()
  for x in intArr:
      if(not x == sortArr[-1]):
          print(sortArr[-1])
      if(x == sortArr[-1]):
          print(sortArr[-2])
# Judge status: Wrong Answer
import math
 
[a, b, h, m] = [int(x) for x in input().split(" ")]
short = ((h) * 60 + m) / (12 * 60) * 360
long = (m) / (60) * 360
theta = abs(long - short)
inte = math.cos(math.radians(theta))
print(math.sqrt(a ** 2 + b ** 2 + 2*a * b * inte))
# Judge status: Wrong Answer
A, B = map(int, input().split())

if (A<=5):
	print(0)

elif(A>6 and A<=12):
	print(int(B/2))

else:
	print(B)
# Judge status: Wrong Answer
from math import gcd

k = int(input())
ans = 0

for i in range(1, k + 1):
  for j in range(1, k + 1):
    for t in range(1, k + 1):
      ans += gcd(gcd(i, j), k)

print(ans)
# Judge status: Accepted
import collections 
n,cc = int(raw_input()), collections.Counter(map(int,raw_input().split()))
m,s = max(cc.keys()),{ai:True for ai in cc}
for a in cc:
	c = a if cc[a] > 1 else 2 * a
	while(c <= m):
		if a in s: s[c] = False
		c += a
count = 0
for v in s.values():
	if v: count +=1
print count
# Judge status: Wrong Answer
S = input()
alp = list('abcdefghijklmnopqrstuvwxyz')
print(alp)
for i in range(len(S)):
  if S[i] in alp:
    alp.remove(S[i])
if len(alp) == 0:
  print('None')
else:
  print(alp[0])