Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import sys
input = sys.stdin.readline

mod = 10**9 + 7
K = int(input())
S = input().rstrip()

N = K + len(S)
fact = [1] * (N+1)
fact_inv = [1] * (N+1)
for i in range(1, N+1):
    fact[i] = i * fact[i-1] % mod
fact_inv[N] = pow(fact[N], mod-2, mod)
for i in range(1, N+1)[::-1]:
    fact_inv[i-1] = i * fact_inv[i] % mod
comb = lambda n, k: fact[n] * fact_inv[k] * fact_inv[n-k] % mod

ans = 0
for i in range(K+1):
    ans = (ans + comb((K - i) + len(S) - 1, len(S) - 1) * pow(25, K - i) * pow(26, i)) % mod
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline

mod = 10**9 + 7
K = int(input())
S = input().rstrip()

N = K + len(S)
fact = [1] * (N+1)
fact_inv = [1] * (N+1)
for i in range(1, N+1):
    fact[i] = i * fact[i-1] % mod
fact_inv[N] = pow(fact[N], mod-2, mod)
for i in range(1, N+1)[::-1]:
    fact_inv[i-1] = i * fact_inv[i] % mod
comb = lambda n, k: fact[n] * fact_inv[k] * fact_inv[n-k] % mod

ans = 0
for i in range(K+1):
    ans = (ans + comb(K - i + len(S) - 1, len(S) - 1) * pow(25, K - i, mod) * pow(26, i, mod)) % mod
print(ans)
### BUGGY CODE ###

k = int(input())

tmp = 7
ans = -1
for i in range(1,10**6):  
  if tmp % k == 0:
    ans = i
    break
  tmp *= 10
  tmp += 7
print(ans)    

### FIXED CODE ###

k = int(input())

tmp = 7
ans = -1
for i in range(1,10**6):  
  if tmp % k == 0:
    ans = i
    break
  tmp *= 10
  tmp = (tmp+7) % k
print(ans)
### BUGGY CODE ###

from operator import mul
from functools import reduce

n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
r = [0] * (n - k + 1)
for i in range(n - k + 1):
    r[i] = reduce(mul, a[i : i + k])

    if i > 0:
        if r[i] > r[i - 1]:
            print("Yes") 
        else: 
            print("No")


### FIXED CODE ###

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

for i in range(k, n):
    if a[i - k] < a[i]:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

N, Q = map(int, input().split())
S = input()
lr = [[0, 0] for _ in range(Q)]
for i in range(Q):
    l, r = map(int, input().split())
    lr[i][0] = l-1
    lr[i][1] = r-1

for i in range(Q):
    ans = 0
    for j in range(lr[i][0], lr[i][1]):
        if S[j] == 'A' and S[j+1] == 'C':
            ans += 1
    print(ans)

### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
Si = [0]*(N+1)
for i in range(1, N):
    if S[i-1] == 'A' and S[i] == 'C':
        Si[i+1] = Si[i] + 1
    else:
        Si[i+1] = Si[i]
for _ in range(Q):
    l, r = map(int, input().split())
    print(Si[r]-Si[l])
### BUGGY CODE ###

N=int(input())
word=[]
word_lst=[]
for i in range(N):
  s=input()
  word.append(s)
  word_lst.append(list(word[i]))
  word_lst[i].sort()
  word_lst[i]=''.join(word_lst[i])

count=0
for i in range(N):
  flag = 0
  for j in range(N):
    if flag == 1:
      pass
    if word_lst[i]==word_lst[j]:
      count=count+1
      flag =flag+1

total=int((count-N)/2)
  
  
print(total)  


### FIXED CODE ###

import collections

n=int(input())
s=[]
set={}
for i in range(n):
    s.append(input())
for i in range(n):
    temp=list(s[i])
    temp.sort()
    s[i]=''.join(temp)
count=0
ans=collections.Counter(s)
countlist=ans.most_common()
for i in range(len(countlist)):
    if countlist[i][1]<=1:
        break
    else:
        temp=countlist[i][1]-1
        count+=(temp+1)*temp//2

print(count)
### BUGGY CODE ###

x,y,a,b,c = map(int,input().split())
p = sorted(list(map(int,input().split())),reverse=True)
q = sorted(list(map(int,input().split())),reverse=True)
r = sorted(list(map(int,input().split())),reverse=True)
ans = 0
for i in range(x,max(-1,x-c-1),-1):
  z = c-(x-i)
  for j in range(y,max(-1,y-1-z),-1):
    ans = max(ans,sum(p[:i])+sum(q[:j])+sum(r[:(x+y-i-j)]))
print(ans)

### FIXED CODE ###

x,y,a,b,c = map(int,input().split())
p = sorted(list(map(int,input().split())),reverse=True)[:x]
q = sorted(list(map(int,input().split())),reverse=True)[:y]
r = list(map(int,input().split()))
print(sum(sorted(p+q+r,reverse=True)[:(x+y)]))
### BUGGY CODE ###

n=int(input())
li=[]
for i in range(n):
  a=int(input())
  if a not in li:
    li.append(a)
  elif a in li:
    li.remove(a)
print(len(li))
    
    
  

### FIXED CODE ###

n = int(input())
li = []
for i in range(n):
    li.append(int(input()))
import collections
a = collections.Counter(li)
a = a.most_common()
num = 0
for i in range(len(a)):
    if a[i][1]%2==1:
        num += 1
print(num)
### BUGGY CODE ###

alp = {"a":2, "b":3,"c":5,"d":7,"e":11,"f":13,"g":17,"h":19,"i":23,"j":29,
       "k":31,"l":37,"m":41,"n":43,"o":47,"p":53,"q":59,"r":61,"s":67,"t":71,
       "u":73,"v":79,"w":83,"x":3.3,"y":2.3,"z":1.3}

n = int(input())

s = []

for i in range(n):
    tss= str(input()) # tss; temporary str s
    ts = 1
    for j in range(10):
      ts *= alp[tss[j]] # ts; temporary s
    s.append(ts)
ss = sorted(s)

a = 0 # a; pre ans

for i in range(n):
    for j in range(1, n - i):
        while ss[i] == ss[i + j]:
            a += 1
       

print(a)  


### FIXED CODE ###

n = int(input())
d = dict()

for _ in range(n):
    s = "".join(sorted([x for x in input()]))
    d[s] = d.get(s, 0) + 1

ans = 0

for v in d.values():
    if v >= 2:
        ans += (v * (v-1)) // 2

print(ans)
### BUGGY CODE ###

k , s = map(int, input().split())
cnt = 0
for x in range(k + 1):
    for y in range(k + 1):
        for z in range(k + 1):
            if s == x + y + z:
                cnt += 1
print(cnt)

### FIXED CODE ###

k , s = map(int, input().split())
cnt = 0
for x in range(k + 1):
    for y in range(k + 1):
        if 0 <= s - x - y <= k:
            cnt += 1
print(cnt)
### BUGGY CODE ###

N = int(input())
li = list(map(int,input().split()))
ans = 0
for i in range(N):
  se = 0
  for j in range(i):
    if li[j] >= li[i]:
      se += 1
    if se == i:
      ans += 1
print(ans+1)

### FIXED CODE ###

N = int(input())
li = list(map(int,input().split()))
ans = 0
mi = N
for i in range(N):
    mi= min(mi,li[i])
    if mi == li[i]:
        ans += 1
print(ans)
### BUGGY CODE ###

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

ans=0
for k in range(K,N):
    if k==0:
        for i in range(1,N+1):
            if N//i==1:
                ans+=N-(i-1)
                break
            else:
                ans+=N//i
    else:
        for i in range(k+1,N+1):
            if (N-k)//i==0:
                ans+=N-(i-1)
                break
            else:
                ans+=1+(N-k)//i
print(ans)

### FIXED CODE ###

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

if K==0:
    print(N**2)
    exit()

ans=0
for i in range(K+1,N+1):
    ans+=N//i*(i-K)+max(0,N%i-(K-1))
print(ans)
### BUGGY CODE ###

from collections import Counter

def fact(n):
    fact = 1
    for i in range(1,n+1):
        fact *= i
    return fact

def combinations_count(n,r):
    return fact(n) // (fact(n - r) * fact(r))

def main():
    N = int(input())
    A = list(map(int, input().split()))
    c = Counter(A)
    comb = 0
    for i in c.values():
        if i >= 2:
            comb += combinations_count(i, 2)
    for i in range(N):
        print(comb - (c[A[i]] - 1))

if __name__ == '__main__':
    main()

### FIXED CODE ###

from collections import Counter

def main():
    N = int(input())
    A = list(map(int, input().split()))
    c = Counter(A)
    comb = 0
    for i in c.values():
        if i >= 2:
            comb += i*(i-1)//2
    for i in range(N):
        print(comb - (c[A[i]] - 1))

if __name__ == '__main__':
    main()
### BUGGY CODE ###

def main():
    ans = 0
    a,b = map(int,input().split())
    for x in range(a+1):
        for y in range(a+1):
            if x+y == b:
                ans += 1
            elif  x + y < b:
                for z in range(a+1):
                    if x + y + z == b:
                         ans += 1
                    elif x + y + z > b:
                        break

    return ans

print(main())


### FIXED CODE ###

def main():
    ans = 0
    a,b = map(int,input().split())
    for x in range(a+1):
        for y in range(a+1):
            z = b-x-y
            if 0<=z and z<=a:
                ans += 1



    return ans

print(main())
### BUGGY CODE ###

n,k = map(int, input().split())
P = [*map(int, input().split())]
# print(n,k)
# print(P)

ans = 1000000000
for i in range(1<<n):
    # print(bin(i))
    v = []
    for j in range(n):
        if i>>j & 1:
          v.append(P[j])
        if len(v) == k: break
    # print(v)
    if len(v) == k:
        ans = min(ans, sum(v))
print(ans)


### FIXED CODE ###

n,k = map(int, input().split())
P = [*map(int, input().split())]

P.sort()

ans = 0
for i in range(k):
    ans += P[i]
print(ans)
### BUGGY CODE ###

h, w = map(int,input().split())
a = [list(map(int,input().split())) for i in range(h)]
b = [list(map(int,input().split())) for i in range(h)]

ab = [[0]*w for i in range(h)]
for ch in range(h):
    for cw in range(w):
        ab[ch][cw] = abs(a[ch][cw] - b[ch][cw])

ab0 = ab[0][0]
size = 80*(h+w)
dp = [[set([]) for ww in range(w)] for hh in range(h)]
dp[0][0] = {ab0, -ab0}
for ch in range(h):
    for cw in range(w):
        if ch < h-1:
            for ci in dp[ch][cw]:
                dp[ch+1][cw].add(ci + ab[ch+1][cw])
                dp[ch+1][cw].add(ci - ab[ch+1][cw])
        if cw < w-1:
            for ci in dp[ch][cw]:
                dp[ch][cw+1].add(ci + ab[ch][cw+1])
                dp[ch][cw+1].add(ci - ab[ch][cw+1])

for i in range(1 + size//2):
    for j in [1, -1]:
        if i*j in dp[h-1][w-1]:
            print(i)
            exit()

### FIXED CODE ###

h, w = map(int,input().split())
a = [list(map(int,input().split())) for i in range(h)]
b = [list(map(int,input().split())) for i in range(h)]

ab = [[0]*w for i in range(h)]
for ch in range(h):
    for cw in range(w):
        ab[ch][cw] = abs(a[ch][cw] - b[ch][cw])

ab0 = ab[0][0]
size = 80*(h+w)
dp = [[0]*w for hh in range(h)]
dp[0][0] |= 2**(size + ab0)
dp[0][0] |= 2**(size - ab0)
for ch in range(h):
    for cw in range(w):
        if ch < h-1:
            dp[ch+1][cw] |= dp[ch][cw] << ab[ch+1][cw]
            dp[ch+1][cw] |= dp[ch][cw] >> ab[ch+1][cw]
        if cw < w-1:
            dp[ch][cw+1] |= dp[ch][cw] << ab[ch][cw+1]
            dp[ch][cw+1] |= dp[ch][cw] >> ab[ch][cw+1]

a = dp[h-1][w-1]>>size
m = a&(-a)
print(m.bit_length()-1)
### BUGGY CODE ###

def main():
    n,k,c=map(int,input().split())
    s=list(input())[::-1]
    sl=[0 if i=='x' else 1 for i in s]
    chk=int(''.join(map(str,sl)),2)
    ans=0
    for i in range(2**(n+1)):
        if i&chk==0:
            continue
        ocnt,cnt,bcnt,f=0,0,0,0
        for j in range(len(bin(i))-1):
            cnt+=1
            if i>>j&1:
                ocnt+=1
                if bcnt!=0:
                    if cnt-bcnt<=c:
                        f=1
                        break
                if ocnt>k:
                    f=1
                    break
                bcnt=cnt
        if f==0 and ocnt==k:
            if chk&i==i:
                if ans==0:
                    ans=i
                else:
                    ans=ans&i
                    if ans==0:
                        exit()
    for i in range(len(bin(ans))-1):
        if ans>>i&1:
            print(i+1)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n,k,c=map(int,input().split())
    s=list(input())
    l,r=[0]*(k+1),[0]*(k+1)
    x,i=1,0
    while i<=n-1:
        if s[i]=='o':
            l[x]=i+1
            i+=c+1
            x+=1
            if x==k+1:
                break
        else:
            i+=1
    x,i=k,n-1
    while 0<=i:
        if s[i]=='o':
            r[x]=i+1
            x-=1
            i-=c+1
            if x==0:
                break
        else:
            i-=1
    for i in range(1,k+1):
        if l[i]==r[i]:
            print(l[i])

if __name__ == '__main__':
    main()
### BUGGY CODE ###

n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(m)]

if len(a) == 1:
    print(a[0][1] - a[0][0] + 1)
else:
    ans = n
    for i in range(1, n + 1):
        for j in range(m):
            if a[j][0] <= i <= a[j][1]:
                continue
            else:
                ans -= 1
                break
    print(ans)


### FIXED CODE ###

n, m = map(int, input().split())

left = []
right = []
for i in range(m):
    a, b = map(int, input().split())
    left.append(a)
    right.append(b)

if min(right) >= max(left):
    print(min(right) - max(left) + 1)
else:
    print(0)
### BUGGY CODE ###

x = input()
while 'ST' in x:
    x = x.replace('ST', '')
print(len(x))


### FIXED CODE ###

x = input()
while 'ST' in x:
    x = x.replace('ST', '')
    n = len(x) // 2
    if ('T' not in x[:n]) and ('S' not in x[n:]):
        x = ''
        break
print(len(x))
### BUGGY CODE ###

from functools import reduce

N=int(input())
*A,=map(int,input().split())
mod = 10**9+7

def gcd(a,b):
  if b == 0:
    return a
  return gcd(b,a%b)

def lcm(a,b):
  return a*b//gcd(a,b)

LCM = reduce(lcm,A)

B = [(LCM//A[i])%mod for i in range(N)]

print(sum(B)%mod)

### FIXED CODE ###

from functools import reduce

N=int(input())
*A,=map(int,input().split())
mod = 10**9+7

def gcd(a,b):
  if b == 0:
    return a
  return gcd(b,a%b)

def lcm(a,b):
  return a*b//gcd(a,b)

LCM = reduce(lcm,A)%mod

print(sum([LCM*pow(A[i],-1,mod)%mod for i in range(N)])%mod)
### BUGGY CODE ###

N,K,Q=map(int,input().split())
mylist=[]
pointlist=[]
for i in range(Q):
    mylist.append(int(input()))
    
#print(N,K,Q)    
#print(mylist)

for i in range(N):
    pointlist.append(K)

i=0
while i<Q:
    winner=mylist[i]-1
    #winner以外のポイントを減らす
    for j in range(N):
        if j==winner: #jがwinnerの番号のときは何もしない
            pass
        else:
            pointlist[j]-=1
    #print(i)
    #print(pointlist)
    i+=1
    
for i in range(N):
    if pointlist[i]<=0:
        print("No")
    else:
        print("Yes")

### FIXED CODE ###

N,K,Q=map(int,input().split())
mylist=[]
pointlist=[]
for i in range(Q):
    mylist.append(int(input()))
    
for i in range(N):
    #全員にKポイント与えるが、Qポイント引く
    pointlist.append(K-Q)
    
#正解者に1ぽいんとずつ足す。

for i in range(Q):
    #mylist[i]をjとしたら、j番目の人が勝者ということ。pointlist[j-1]に1を足す。
    j=mylist[i]
    pointlist[j-1]+=1
    
for i in range(N):
    if pointlist[i]>0:
        print("Yes")
    else:
        print("No")
### BUGGY CODE ###

N = int(input())
S = input()
ans = 0
for i in range(1000):
    tmp = str(i)
    while len(tmp) < 3:
        tmp = '0' + tmp
    count = 0
    for k in S:
        if count < 3 and k == tmp[count]:
            count += 1
    if count == 3:
        ans += 1
print(ans)

### FIXED CODE ###

N = int(input())
S = input()
ans = 0
for i in range(1000):
    tmp = str(i)
    while len(tmp) < 3:
        tmp = '0' + tmp
    count = 0
    target = S
    for i in tmp:
        target = target.replace(i,'')
    for k in S:
        if 3 <= count:
            break
        if k == tmp[count]:
            count += 1
    if count == 3:
        ans += 1
print(ans)
### BUGGY CODE ###

import bisect

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

BC = []
for _ in range(M):
    b, c = map(int, input().split())
    BC.append((b, c))

BC.sort(reverse=True, key=lambda x: x[1])

ans, i = 0, 0
for bc in BC:
    ti = bisect.bisect(A[i:], bc[1]) + i
    if (ti > i) and (bc[0] >= (ti - i)):
        ans += bc[1] * (ti - i)
        i = ti
    elif (ti > i) and (bc[0] < (ti - i)):
        ans += bc[1] * bc[0]
        i = i + bc[0]

print(ans + sum(A[i:]))


### FIXED CODE ###

import bisect

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

BC = []
for _ in range(M):
    b, c = map(int, input().split())
    BC.append((b, c))

BC.sort(reverse=True, key=lambda x: x[1])

ans, i = 0, 0
for bc in BC:
    ti = bisect.bisect(A, bc[1])
    if (ti > i) and (bc[0] >= (ti - i)):
        ans += bc[1] * (ti - i)
        i = ti
    elif (ti > i) and (bc[0] < (ti - i)):
        ans += bc[1] * bc[0]
        i = i + bc[0]

print(ans + sum(A[i:]))
### BUGGY CODE ###

import sys
input = sys.stdin.readline


def main():
    N = int(input())
    s = [sorted(input().strip()) for _ in range(N)]
    ans = 0
    for i in range(N-1):
        for j in range(i+1, N):
            if s[i] == s[j]:
                ans += 1
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
from collections import defaultdict
input = sys.stdin.readline


def main():
    N = int(input())
    d = defaultdict(lambda: 0)
    for _ in range(N):
        s = ''.join(sorted(input().strip()))
        d[s] += 1

    ans = 0
    for v in filter(lambda x: x > 1, d.values()):
        ans += (v - 1) * v // 2
    print(ans)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

import math
from collections import Counter

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


def main():
    N = int(input())
    A = list(map(int, input().split()))
    a = Counter(A)
    def find(x):
        l = make_divisors(x)
        for j in l:
            if j == x:
                if a[j] > 1:
                    return 0
            else:
                if j in a:
                    return 0
        return 1
    r = 0
    for i in A:
        r += find(i)
    return r
print(main())


### FIXED CODE ###

#dame datta....
from collections import Counter
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = sorted(A)
    a = Counter(A)
    l = [0] * (10**6+1)
    v = [0] * (10**6+1)
    for i in B:
        if v[i] == 1 or l[i] == 1:
            continue
        else:
            v[i] = 1
        t = 2*i
        while t < 10**6 + 1:
            l[t] = 1
            t += i
    r = 0
    for i in A:
        if l[i] == 0 and a[i] == 1:
            r += 1
    return r
print(main())
### BUGGY CODE ###

n=int(input())
buff=[]
for i in range(n):
    a=int(input())
    if a in buff:
        buff.remove(a)
    else:
        buff.append(a)

print(len(buff))

### FIXED CODE ###

n=int(input())
buff=[]
ans=1
for i in range(n):
    buff.append(input())

a=sorted(buff)

for i in range(1,n):
    if a[i] == a[i-1]:
        a[i-1]= -1
        a[i]= -1
        if ans>0:
            ans -= 1
    else:
        ans += 1

print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline

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

import numpy as np
p=np.zeros(N).astype(int)+K

for i in range(Q):
  j=int(input())-1
  p[j]=p[j]+1
  p=p-1
  
for i in range(N):
  if p[i]<1:
    print('No')
  else:
    print('Yes')

### FIXED CODE ###

import sys
input = sys.stdin.readline

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

p=[-Q]*N

for i in range(Q):
  j=int(input())-1
  p[j]=p[j]+1

for i in range(N):
  if p[i]+K<1:
    print('No')
  else:
    print('Yes')
### BUGGY CODE ###

import copy

s="Z"
s+=input()
len_s=len(s)

def work(s,totalnum):
  new_s=["Z"]
  num=0
  skipnum=0
  for i in range(1,len_s):
    #print(i,s,new_s)
    if skipnum>0:
      skipnum-=1
      continue

    if i<=len_s-3:
      if s[i]=="A" and s[i+1]=="B" and s[i+2]=="C":
        new_s.append("B")
        new_s.append("C")
        new_s.append("A")
        num+=1
        skipnum+=2
      else:
        new_s.append(s[i])
    else:
        new_s.append(s[i])

  totalnum+=num
  #print("d")
  #print(s,new_s)
  if num==0:
    return totalnum
  else:
    return work(new_s,totalnum)

print(work(s,0))

### FIXED CODE ###

s=input()
t=s.replace("BC","D")
a=0
ans=0
for i in t:
  if i=="A":
    a+=1
  elif i=="D":
    ans+=a
  else:
    a=0

print(ans)
### BUGGY CODE ###

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

c = collections.Counter(a)

keys, values = zip(*c.most_common())

ans = 0

for i in values:
  if i != 1:
  	ans += (i*(i-1)//2)

for i in a:
    for j in range(len(keys)):
      if i == keys[j]:
        co = values[j]
        break
    print(ans-(co*(co-1)//2)+((co-1)*(co-2)//2))

      

### FIXED CODE ###

import collections
n = int(input())
a = list(map(str,input().split()))
ls = [i for i in range(2*10**5)]
c = collections.Counter(a)
comon = c.most_common()
ans = 0

for i in comon:
    if i != 1:
      ls[int(i[0])] = i[1]
      ans += (i[1]*(i[1]-1)//2)

for i in a:
    co = ls[int(i)]
    print(ans-(co*(co-1)//2)+((co-1)*(co-2)//2))
### BUGGY CODE ###

N, a, b = map(int, input().split())

sum = pow(2, N)

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
#N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ax = cmb(N, a, mod)
bx = cmb(N, b, mod)

print((sum - ax - bx - 1)%(10**9+7))

### FIXED CODE ###

N, a, b = map(int, input().split())

MOD = 10**9+7

def modcmb(n, r, m):
    x = 1
    y = n
    for i in range(2,r+1):
        x *= i
        x %= MOD
        y *= n-i+1
        y %= MOD
    return y * pow(x, m-2, m) % m

ans = pow(2, N, MOD) - modcmb(N, a, MOD) - modcmb(N, b, MOD) - 1
print(ans % MOD)
### BUGGY CODE ###

n = input()
A = input().split(' ')
A.sort()
q = input()
M = input().split(' ')

A = list(map(int,A))
M = list(map(int,M))

#memo = [True]*(len(A))

def search(base, m, n):
    if base == m:
        return True
    result = False
    for i in range(n,len(A)):
        if base + A[i] <= m: # and memo[i]:
#           memo[i] = False
#           print(str(A[i]) + ',' + str(base+A[i]) + ',')
            if search(base+A[i], m, i+1):
                return True
#           memo[i] = True
    return result

def print_yn(result):
    if result:
        print('yes')
    else:
        print('no')

for m in M:
#   print(str(m)+':')
    print_yn(search(0,m,0))

### FIXED CODE ###

n = input()
A = input().split(' ')
A.sort()
A.reverse()
q = input()
M = input().split(' ')

A = list(map(int,A))
M = list(map(int,M))
A.sort()

A_sum = [0]
for a in A:
    A_sum.append(a+A_sum[-1])
A_sum.pop(0)

A.reverse()
A_sum.reverse()


#memo = [True]*(len(A))

def search(base, m, n):
    if base == m:
        return True
    if len(A)-1 < n or m - base > A_sum[n]:
        return False
    result = False
    for i in range(len(A)-1,n-1,-1):
        if base + A[i] <= m: # and memo[i]:
#           memo[i] = False
#           print(str(A[i]) + ',' + str(base+A[i]) + ',')
            if search(base+A[i], m, i+1):
                return True
#           memo[i] = True
    return result

def print_yn(result):
    if result:
        print('yes')
    else:
        print('no')

for m in M:
#   print(str(m)+':')
    print_yn(search(0,m,0))
### BUGGY CODE ###

n,k=map(int, input().split())
while n>abs(n-k):
    n=abs(n-k)
print(n)

### FIXED CODE ###

n,k=map(int, input().split())
t1=n%k
t2=k-n%k
print(min(t1,t2))