peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
def comb(n, k, mod):
    if k == 0:
        return 1
    else:
        x, y = n, k
        for i in range(1, k):
            x = x * (x - i) % mod
            y = y * (y - i) % mod
        c = x * pow(y, mod - 2, mod) % mod
        return c


x, y = map(int, input().split())
mod = 10 ** 9 + 7
n = (x + y) // 3
if (x + y) % 3 != 0 or not (n <= x <= 2 * n):
    ans = 0
else:
    k = min(x - n, 2 * n - x)
    ans = comb(n, k, mod)
print(ans)
# Judge status: Wrong Answer
n=int(input())
s=input()

black_sum=s.count("#")
white_sum=n-black_sum
black=0
white=0
for i in range(n):
    if s[i]==".":
        black=i
        break
    
for i in range(n):
    if s[~i]=="#":
        white=~i+n
        
ans=min(black_sum-black,white_sum-white)
print(ans)
# Judge status: Wrong Answer
A,B = map(int, input().split())
count = 0
for i in range(1,10):
  for j in range(10):
    for k in range(10):
      for l in range(10):
        for m in range(10):
          k = 10000*i + 1000*j +100*k +10*l + m
          if A <= k and k <= B:
            ka = str(k)
            karray = list(map(int, ka))
            if karray == karray.reverse:
              count += 1
print(count)
# Judge status: Accepted
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

if N>K:
    print(X*K+Y*(N-K))
else:
    print(X*N)
# Judge status: Accepted
from math import sqrt

n = int(input())

ans = int(sqrt(n))

if (ans + 1) * (ans + 1) <= n:
    print((ans + 1) * (ans + 1))
elif ans * ans <= n:
    print(ans * ans)
else:
    print((ans - 1) * (ans - 1))
# Judge status: Accepted
s=input()
ans=0
for i in range(len(s)):
  if int(s[i])==(i%2):
    ans+=1
print(min(ans,len(s)-ans))
# Judge status: Accepted
n = int(input())
lst = [i for i in range(1, n+1) if i % 3 != 0 and i % 5 != 0]
print(sum(lst))
# Judge status: Accepted
import sys
def S(): return sys.stdin.readline().rstrip()
N = S()
if all([n=='9' for n in N[1:]]):
    print(int(N[0])+9*(len(N)-1))
else:
    print(int(N[0])-1+9*(len(N)-1))
# Judge status: Accepted
import fractions
import math
from functools import reduce
import sys
sys.setrecursionlimit(10**8)


def lcm2(x, y):
    return (x * y) // fractions.gcd(x, y)


def lcm(numbers):
    return reduce(lcm2, numbers)


n, m = map(int, input().split())
a = list(map(int, input().split()))
count = 0
while all(x % 2 == 0 for x in a):
    count += 1
    a = list(map(lambda x: x//2, a))

if any(x % 2 == 0 for x in a):
    print(0)
    exit()

lcm = lcm(a)
print(m // (lcm * (2 ** (count - 1))) - m // (lcm * (2 ** count)))
# Judge status: Accepted
S=list(input())
ans=""
for i in range(len(S)):
    ans+="x"
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
S = input()
Slist = [char for char in S]

Slist[K-1] = Slist[K-1].lower()

for str in Slist:
  print(str, end='')
# Judge status: Accepted
n,m=map(int, input().split())
a=list(map(int, input().split()))
print(max(-1,n-sum(a)))
# Judge status: Accepted
import heapq

n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort(key = lambda x:x[0])
ab.append([10 ** 10, 0])
ans = 0
cand = []
day = 1
pos = 0
while day <= m:
    while ab[pos][0] <= day:
        heapq.heappush(cand, ab[pos][1] * -1)
        pos += 1
    day += 1
    if cand:
        ans += heapq.heappop(cand) * -1
print(ans)
# Judge status: Accepted
S, T = input().split()
A, B = map(int, input().split())
U = input()
if U == S:    A -= 1
else: B -= 1
print(A, B)
# Judge status: Wrong Answer
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    q, h, s, d = map(int, input().split())
    n = int(input())
    t = min(q * 4, h * 2, s)
    if n == 1:
        print(int(t))
    else:
        if n % 2 == 0:
            print(int(min(t * n, d * n // 2)))
        else:
            print(t * n, d * ((n - 1) // 2) + t)
            print(int(min(t * n, d * ((n - 1) // 2) + t)))


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
import sys

input = sys.stdin.readline

A, B, M = map(int, input().strip().split())

A = list(map(int, input().strip().split()))
B = list(map(int, input().strip().split()))
ans = min(A) + min(B)
query = [list(map(int, input().strip().split())) for i in range(M)]
for i, q in enumerate(query):
    x, y, m = q
    ans = min(A[x-1]+B[y-1]-m, ans)
print(ans)
# Judge status: Wrong Answer
n = int(input())
A = list(map(int, input().split()))
q = int(input())

total = sum(A)
dic = {}
for i in range(q):
  b, c = map(int, input().split())
  b_count = A.count(b)
  c_count = A.count(c)
  dic[c] = c_count + b_count
  if b in dic:
    b_count = dic[b]
  diff = c - b
  total += b_count*diff
  print(total)
# Judge status: Accepted
N = int(input())

def dfs(x):
    memo = [0]*(x+1)
    def _dfs(x):
        if x == 0:
            return 2
        elif x == 1:
            return 1
        elif memo[x] != 0:
            return memo[x]
        else:
            memo[x] = _dfs(x-1) + _dfs(x-2)
            return memo[x]
    return _dfs(x)

print(dfs(N))
# Judge status: Accepted
c = input()
_ = [chr(i) for i in range(97,97+26)]
print(_[_.index(c) + 1])
# Judge status: Wrong Answer
import math
n, d = list(map(int, input().split()))
cnt = 0
for i in range(n):
  x, y = list(map(int, input().split()))
  ans = math.sqrt(x*x + y*y)
  if ans>=d:
    cnt+=1
print(cnt)
# Judge status: Wrong Answer
n = int(input())
l= list(map(int,input().split()))
c = [0] * (10 ** 5 + 1)
for i in l:
  c[i] += 1
n = int(input())
s = sum(c)
for i in range(n):
  be,af = map(int,input().split())
  s -= be * c[be]
  s += af * c[be]
  c[af] += c[be]
  c[be] = 0
  print(s)
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split(" ")))
b = list(map(int, input().split(" ")))
a_cnt, b_cnt = 0, 0

for i in range(N):
    # aiをbiに近づける
    if a[i] < b[i]:
        num = (b[i] - a[i] + 1) // 2
        a_cnt += num
        a[i] += 2 * num

for i in range(N):
    # biをaiに近づける
    if b[i] < a[i]:
        b_cnt += (a[i] - b[i])

if a_cnt >= b_cnt:
    print("Yes")
else:
    print('No')
# Judge status: Accepted
import math

n, x = map(int, input().split())
a = list(map(int, input().split()))
b = []
for i in range(n):
  b.append(abs(x-a[i]))
ans = b[0]
for j in range(1, n):
  ans = math.gcd(ans, b[j])
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
ans = 0
if m >= 2*n:
    ans += n
    m -= 2*n
else:
    ans += m//2
    m = 0
if m > 0:
    ans += m // 4
print(ans)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
  N = int(input())
  S = input()

  sum = S.count('R') * S.count('G') * S.count('B')

  for i in range(N-2):
    for j in range(i+1, N-1):
      k = j+(j-i)
      if k < N:
        if S[i] == S[j] or S[i] == S[k] or S[k] == S[j]:
          continue
        sum -= 1
  print(sum)

if __name__ == '__main__':
  main()
# Judge status: Wrong Answer
# coding: utf-8
sa = input()
sb = input()
sc = input()
d = {"A":sa, "B":sb, "C":sc}
s = d["A"][0].upper()
d["A"] = d["A"][1:]
while True:
    if len(d[s]) == 0:
        print(s)
        break
    s = d[s][0].upper()
    d[s] = d[s][1:]
# Judge status: Accepted
a, b, x=map(int, input().split())

if a+b>=x and a<=x:
	print('YES')
else:
	print('NO')
# Judge status: Accepted
N, M = map(int,input().split())
ll = [list(map(int,input().split())) for j in range(M)]

a = [0]*N
b = [0]*N

for i in range(M):
    if ll[i][0] == 1:
        a[ll[i][1]-1] += 1
    if ll[i][1] == N:
        b[ll[i][0]-1] += 1

for i in range(N):
    if a[i] != 0 and b[i] != 0:
        print("POSSIBLE")
        exit()
    else:
        pass
print("IMPOSSIBLE")
# Judge status: Accepted
O=list(input())
E=list(input())+[""]
for x,y in zip(O, E):#zipにしてあげることで自動的にOが奇数、Eが偶数の場所になる
    print(x+y,end="")#あとは順次出力
# Judge status: Accepted
n,m = map(int,input().split())
c = [0]*n
for i in range(m):
    a,b = map(int,input().split())
    c[a-1] += 1
    c[b-1] += 1

for ci in c:
    print(ci)
# Judge status: Accepted
n = int(input())
print(0 if n % 1000 == 0 else 1000 - (n % 1000))
# Judge status: Accepted
S=input()
for i in range(ord("a"),ord("z")+1):
  if chr(i) in S:
    continue
  else:
    print(chr(i))
    exit()
print("None")
# Judge status: Accepted
import math
import sys
readline = sys.stdin.readline

S = int(readline().strip())

p =10**9 +7

n = S//3

ans = 0

for i in range(1, n+1):
  si = S - 3*i
  ai = math.factorial(si+i-1)
  bi = math.factorial(si)
  ci = math.factorial(i-1)
  ai //= bi
  ai //= ci
  ans += ai
  ans %= p

print(ans)
# Judge status: Accepted
import collections
w=list(input())
alpha=[chr(i) for i in range(97, 97+26)]
beautiful=True
C=collections.Counter(w)
for i in alpha:
    if C[i]%2==1:
        beautiful=False
if beautiful:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n,m=map(int,input().split())
a=[-1]*n
for i in range(m):
    s,c=map(int,input().split())
    s-=1
    if a[s]==-1 or a[s]==c:
        a[s]=c
    else:
        print(-1)
        exit()
if n==1 and a[0]==0:
    print(0)
    exit()
if a[0]==-1:
    a[0]=1
if a[0]==0:  
    print(-1)
    exit()
b=""
for i in a:
    if i==-1:
        b+="0"
    else:
        b+=str(i)
print(b)
# Judge status: Accepted
def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return set([i for i in range(n + 1) if is_prime[i]])
sosuu = primes(10**6)
N=int(input())
for i in range(N,10**6):
 if i in sosuu:
  print(i)
  break
# Judge status: Accepted
a,b,x=map(int,input().split())
if  a>x:
    print("NO")
else:
    if x<=a+b:
        print("YES")
    else:
        print("NO")
# Judge status: Wrong Answer
N,P = map(int,input().split())
A = list(map(int,input().split()))
ce = 0
co = 0
for i in range(N):
    if A[i]%2==0:
        ce += 1
    else:
        co += 1
n = (2**ce)*2**(co-1)
if P==0:
    print(n)
else:
    print(2**N-n)
# Judge status: Accepted
l = int(input())

ans = (l/3)**3
print(ans)
# Judge status: Accepted
a,b = map(int,input().split())

if a==b:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer

def resolve():
    N = int(input())
    temp = 0
    for count in range(N):
        if count % 3 == 0 and count % 5 == 0:
            pass
        elif count % 3 == 0:
            pass
        elif count % 5 == 0:
            pass
        else:
            temp += count
    print(temp)
resolve()
# Judge status: Wrong Answer
N, A, B, C, D = map(int, input().split())
S = input()
if S.count("##", A, D):
    print("No")
elif C < D:
    print("Yes")
elif S.count("...", B - 1, D + 2):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N, A, B = map(int, input().split())
max = B*(N-1)+A
min = A*(N-1)+B

if(A > B):
    print(0)
elif(A == B):
    print(1)
else:
    if N > 1:
        print(max - min + 1)
    else:
        print(0)
# Judge status: Accepted
x = input()
if x == 'a' or x =='e' or x == 'i' or x =='o' or x =='u':
    print('vowel')
else:
    print('consonant')
# Judge status: Accepted
a,b,c = map(int,input().split())
if a == b == c:
  print(1)
elif a != b != c and a != c:
  print(3)
else:
  print(2)
# Judge status: Accepted
S = input()
n = len(S)
shift_max = [0]*(n+1)

big_run = 0
for i in range(n):
    if S[i] == '<':
        big_run += 1
    else:
        big_run = 0
    shift_max[i+1] = big_run
small_run = 0
for i in reversed(range(n)):
    if S[i] == '>':
        small_run += 1
    else:
        small_run = 0
    shift_max[i] = max(shift_max[i],small_run)

print(sum(shift_max))
# Judge status: Accepted
num_dic = {}
word_list = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
for n, word in enumerate(word_list):
    num_dic[word] = 7 - n

s = input()
print(num_dic[s])
# Judge status: Wrong Answer
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
 
c = read().decode("utf-8")
l = [chr(ord('a') + i) for i in range(26)]
 
if c == "z":
    print("a")
    quit()
 
f = False
for a in l:
    if a == c:
        f = True
        continue
    if f:
        ans = a.strip()
        print(ans)
        quit()
# Judge status: Accepted
from heapq import heappush, heappop
import sys

input = sys.stdin.buffer.readline
n, m = map(int, input().split())
AB = []
AB = [list(map(int, input().split())) for _ in range(n)]
AB.sort(key=lambda x: [-x[0], -x[1]])
ans = 0
kouho = []
for d in range(1, m + 1):
    while AB and AB[-1][0] <= d:
        a, b = AB.pop()
        heappush(kouho, (-b, a))
    if kouho:
        p, q = heappop(kouho)
        ans += -p
print(ans)
# Judge status: Accepted
N = int(input())
W = []
for _ in range(N):
  a,b = map(int,input().split())
  W.append((a,b))
W.sort(key=lambda x: x[1])

cur = 0
for a,b in W:
  if cur+a > b:
    print("No")
    exit()
  cur += a 

print("Yes")
# Judge status: Accepted
# AtCoder Beginner Contest 058
# A - ι⊥l
a, b, c = map(int, input().split())
if b-a == c-b:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
from sys import stdin
n,m = map(int,input().split())
sen = list(map(int,input().split()))
count = 0
al = 0
for i in sen:
    al += i
for i in sen:
    if i >= al/(4*m):
        count += 1
if count >= m:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input())
a = int(input())
if n - 500*(n//500) <=a:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n , k = map(int, input().split())
ans=0
for i in range(k,n+2):
    ans+=n*i-i**2+i+1
    ans%=1000000007
print(ans)
# Judge status: Accepted
n,m=map(int,input().split())
if n>=2 and m>=2:
    print((n-2)*(m-2))
elif n==1 and m>=2:
    print(m-2)
elif m==1 and n>=2:
    print(n-2)
elif m==1 and n==1:
    print(1)
# Judge status: Wrong Answer
A,B = (int(x) for x in input('A,B = ').split())
print(A*B)
# Judge status: Accepted
l = list(map(str, input().split(" ")))
print(l[-1] + l[0])
# Judge status: Wrong Answer
if __name__ == '__main__':
	n,m,x,y = map(int,input().split())
	X = list(map(int,input().split()))
	Y = list(map(int,input().split()))
 
	x_max = max(X)
	y_min = min(Y)

	for Z in range(x+1,y+1):
		if x_max < Z <= y_min:
			flg = True
			print("No war")
			exit()
	print("War")
# Judge status: Accepted
n = int(input())
# mapはcallable, iterator
# input().split()でリストを作成する
a = [int(i) for i in input().split()]
iSSequence = [False] * (len(a) - 1)

# a[i]のあとにa[i+1]を食べたならフラグを立てる
for i in range(len(a) - 1):
    if(a[i] + 1 == a[i + 1]):
        iSSequence[a[i] - 1] = True

sum = 0
# bは必ずすべて足される
for b in input().split():
    sum += int(b)

index = 0
for c in input().split():
    if(iSSequence[index]):
        sum += int(c)
    index += 1

print(sum)
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))
p=0
for i in range(N):#O(200000)
  p=p^a[i]
#これでpは各猫のxorになったはず
ls=[]
for i in range(N):#O(200000)
  ls.append(p^a[i])
print(' '.join(map(str, ls)))
# Judge status: Wrong Answer
s=input()
S=sorted(s)
S.sort()
flag=False
if S[0]==S[1]:
    if S[2]==S[3]:
        flag=True
if flag:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n, a, b = map(int, readline().split())
    ans = max(b * (n - 2) - a * (n - 2) + 1, 0)
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n, a, b = [int(i) for i in input().split()]
border = a + b
foreign_pass = 0
passed = 0
s = input()
for x in s:
    if passed >= border:
        print('No')
        continue
    if x == 'a':
        print('Yes')
        passed += 1
    elif x == 'b' and foreign_pass < b:
        print('Yes')
        foreign_pass += 1
    else:
        print('No')
# Judge status: Accepted
N, K, S = list(map(int, input().split()))

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

for i in range(2, 10**6):
    if gcd(S, i) == 1:
        break

ans = []
ans.extend([S for _ in range(K)])
ans.extend([i for _ in range(N-K)])

ans_str = ""
for j in range(len(ans)):
    ans_str += str(ans[j])
    ans_str += " "
ans_str = ans_str[:len(ans_str) - 1]
print(ans_str)
# Judge status: Wrong Answer
A, B = map(int, input().split())
if((A and B)<=9):
    print(int(A*B))
else:
    print('')
# Judge status: Wrong Answer
def resolve():
    import math
    X, Y = map(int, input().split())
    if X == Y:
        print("-1")
    else:
        for i in range(2, X):
            if X%i == 0 and X*i%Y != 0:
                print(X*i)
                exit()
        print("-1")
resolve()
# Judge status: Accepted
ss=input().strip()
flg=False
for i in range(1,len(ss)):
  if ss[i]==ss[i-1]:
    flg=True
    
if flg==True:
  print("Bad")
else:
  print("Good")
# Judge status: Accepted
def myAnswer(S:dict) -> str:
   target = "a"
   while True:
      if(S[target] == []):
         return target.upper()
      else:
         target = S[target].pop(0)

def modelAnswer():
   return
def main():
   S = {chr(97+i):list(input()) for i in range(3)}
   print(myAnswer(S))
if __name__ == '__main__':
   main()
# Judge status: Accepted
from collections import Counter

s = list(input())

c = Counter(s)

print(min(c["0"],c["1"])*2)
# Judge status: Accepted
S=str(input())
i = 0
yasui = True
for s in S:
  if i%2==0 and s=='L':
    yasui = False
  if i%2!=0 and s=='R':
    yasui = False
  i=i+1
if yasui:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
# coding: utf-8
# 日本語を入力できるようにするために上記一文が必要


D,T,S = map( int , input().split())


if D/S <= T:
        print("Yes")
else:
        print("No")
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
c=0
for i in range(n):
    c+=a[i]%2
    if a[i]%2==1:
        b[i]+=i+1
print(sum(b))
b1=[str(n) for n in b]
print(' '.join(b1))
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
cnt, num = 0, 1
if 1 not in a:
    print(-1)
else:
    for i in range(n):
        if a[i] == num:
            num += 1
        else:
            cnt += 1
    print(cnt)
# Judge status: Accepted
import collections


n = int(input())
keep = []
ans = 0
for i in range(n):
    j = int(input())
    keep.append(j)

c = collections.Counter(keep)
print(len([i[0] for i in c.items() if i[1] % 2 != 0]))
# Judge status: Accepted
Num=int(input())
if Num%2==0:
    print(Num/2/Num)
else:
    print((Num//2+1)/Num)
# Judge status: Accepted
import sys

N = int(sys.stdin.readline().strip())
A = map(int, sys.stdin.readline().strip().split())

not_even = 0
even = 0
four = 0 # % 4 = 0

for a_i in A:
    if a_i % 4 == 0:
        four += 1
    elif a_i % 2 == 0:
        even += 1
    else:
        not_even += 1

if not_even > four + 1:
    print("No")
else:
    if not_even == four + 1:
        if even == 0:
            print("Yes")
        else:
            print("No")
    else:
        print("Yes")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

flag = [-1]*n
t = 1
for i in range(n-1, -1, -1):
  if t == 1:
    if a[i-1] < a[i]:
      flag[i] = t
      t = 0
  else:
    if a[i] < a[i-1]:
      flag[i] = t
      t = 1
    
t = 0
s = 0
ans = 1000
for i in range(n):
  if flag[i] == 0:
    t = 1-t
    s = ans//a[i]
    ans %= a[i]
  elif flag[i] == 1:
    t = 1-t
    ans += s*a[i]
    s = 0
print(ans)
# Judge status: Wrong Answer
n = int(input())
h = list(map(int, input().split()))
cnt = 0
ans = 0
for i in range(n-1):
    if h[i] >= h[i+1]: cnt += 1
    else:
        if ans < cnt:
            ans = cnt
            cnt = 0
print(cnt)
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))

def is_ok(X):
    # 全部をX以下にするために切る回数 <= K
    cnt = 0
    for i in range(N):
        cnt += (A[i]-1)//X
    return cnt <= K
 
def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok
  
print(meguru_bisect(0, 10**9))
# Judge status: Accepted
N,K,Q=map(int,input().split())
p=[0]*N
s=0
for x in range(Q):
  A=int(input())
  p[A-1]+=1
  s+=1
for y in range(N):
  if K+p[y]-s>0:
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
n,k,q=list(map(int,input().split()))
t=[0]*n

for i in range(q):
  a=int(input())
  t[a-1]+=1

for j in range(n):
  print('Yes' if k-q+t[j]>0 else 'No')
# Judge status: Accepted
f,g=lambda:map(int,input().split()),sorted;x,y,*_=f();print(sum(g(g(f())[-x:]+g(f())[-y:]+g(f()))[-x-y:]))
# Judge status: Accepted
n, r = map(int, input().split())
print(r + max(1000 - 100 * n, 0))
# Judge status: Accepted
K, X = map(int,input().split())

for kuro in range(X-K+1, X+K):
  print(kuro, end=' ')
# Judge status: Wrong Answer
a = input()
a = str(a)
print(a[0],a[1],a[2])
# Judge status: Accepted
# -*- coding: utf-8 -*-
H, W = map(int, input().split())
if H > 1 and W > 1:
    print((H * W) // 2 + (H * W) % 2)
else:
    print(1)
# Judge status: Wrong Answer
def main():
    K, N = map(int, input().split(' '))
    half_k = K // 2
    A = list(map(int, input().split()))
    A.sort()
    a_sub = A[-1] - A[0]
    if A[-1] > half_k:
        a_sub = (A[-1] - half_k) + A[0]
    if a_sub < 0:
        a_sub *= -1
    for n in range(N - 1):
        if A[n + 1] - A[n] > a_sub:
            a_sub = A[n + 1] - A[n]
    print(K - a_sub)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
A, B, C, K = map(int, input().split())
print(A-B)
# Judge status: Wrong Answer
n=int(input())
hoge=list(map(int,input().split()))
ans=0
wa=hoge[0]
for i in range(1,n):
  ans+=wa*hoge[i]
  wa+=hoge[i]
print(ans)
# Judge status: Accepted
a, b, c, d = map(int,input().split())
if abs(c - a) <= d or (abs(b - a) <= d and abs(c - b) <= d) :
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
D, T, S = map(int, input().split())
if D<S*T:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n, c, k = map(int, input().split())

t = [0] * n
for i in range(n):
    t[i] = int(input())
t = sorted(t)
ans = 0
i = 0
while i < n:
    j = 1
    while i + j < n and t[i + j] <= t[i] + k and j < c:
        j += 1
    i += j
    ans += 1 
print(ans)
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().rstrip()
import heapq

N, M = map(int,input().split())
A = list(map(lambda x:int(x) * (-1),input().split()))
heapq.heapify(A)

for i in range(M):
    a = heapq.heappop(A)
    a *= -1
    a /= 2
    a *= -1    
    heapq.heappush(A,a)

price = 0
for a in A:
    price += (-1) * a

print(price)
# Judge status: Wrong Answer
from math import log2
import decimal

N, K = map(int, input().split())

ans = 0

decimal.getcontext().prec = 12

for i in range(1, N+1):
    if i < K:
        power = -(-(log2(K) - log2(i))//1)
        prob = decimal.Decimal(1/((2**power) * N))
    else:
        prob = decimal.Decimal(1/N)

    #print(prob)
    ans = decimal.Decimal(ans + prob)

print(ans)
# Judge status: Accepted
x=int(input())
if(x%2==0):
    a=x/2
else:
    a=x//2
y=2*a+1
import math
def is_prime(n):
    for i in range(2,int(math.sqrt(n))+1):
        if n%i==0:
            return False
    return True
while(True):
    if(is_prime(y)):
        break
    y=y+2
if(x==2):
    y=2
print(str(int(y)))
# Judge status: Accepted
a, b, x = map(int, input().split())
y = x / (a ** 2)
import math
ans = math.atan((2 * b - 2 * y) / a) * 360 / 2 / math.pi
if 2 * b - 2 * y > b:
  ans = math.atan((b ** 2) / (2 * a * y)) * 360 / 2 / math.pi
print(ans)
# Judge status: Accepted
n = int(input())
b = list(map(int,input().split()))
a = []
a.append(b[0])
for i in range(n-2):
  a.append(min(b[i],b[i+1]))
a.append(b[n-2])
print(sum(a))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

import collections

c = collections.Counter(A)

sum_all = sum([v * max(v - 1, 0) // 2 for k, v in c.items()])

ans = []
for a in A:
  b = c[a]
  ans_a = sum_all - (b * max(b - 1, 0) // 2) + (max(b - 1, 0) * max(b - 2, 0) // 2)
  ans.append(ans_a)
print(*ans, sep='\n')
# Judge status: Accepted
import collections

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

S = 0
c = collections.Counter(A)
for v in c.values():
    S = S + v*(v-1)//2
for i in range(len(A)):
    print(S-c[A[i]]+1)