Harryxun/stf_run huggingface dataset:
S = input()
K = int(input())

for i in range(len(S)):
    if S[i] != '1':
        print(S[i])
        break
    else:
        if i == N - 1:
            print(1)
            break
        else:
            continue

### FIXED CODE ###

S = input()
K = int(input())

for i in range(len(S)):
    if S[i] != '1':
        print(int(S[i]))
        break
    else:
        if i == K - 1:
            print(1)
            break
        else:
            continue
import math

h = float(input())
a = float(input())

print(math.ceil(h/a))

### FIXED CODE ###

import math

val = input().split(' ')
h = float(val[0])
a = float(val[1])

print(math.ceil(h/a))
# input
a, b = input().split()

# constraints
if type(a)!='int' or type(b)!='int':
    print('型がintではありません')
    raise TypeError

if a > 1000 or b > 10000 or a<0 or b<0:
    print('制約違反です')
    raise ValueError
    

# result
if (a*b)%2 == 0:
    print('Even')
else:
    print('odd')    

### FIXED CODE ###

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

# result
if (a*b)%2 == 0:
    print('Even')
else:
    print('Odd')
A,B,C = input().split()
K = int(input())
first = "N"
second = "N"
f = 1
s = 1
for i in range(1,K):
    if int(A) < int(B)*f:
        first = "Y"
        nokori = i
        break
    else:
        f *= 2
        print(f)
if int(A) < int(B)*f:
        first = "Y"
        nokori = i

if first == "Y":
    for o in range(1,nokori):
        if int(B) < int(C)*(s**2):
            second = "Y"
            break
        else:
            s *= 2
    if int(B)*f < int(C)*(s**2):
            second = "Y"
        
if first == "Y" and second == "Y":
    print("Yes")
else:
    print("No")

### FIXED CODE ###

A,B,C = input().split()
K = int(input())
first = "N"
second = "N"
f = 1
s = 1
nokori = K
for i in range(1,K):
    if int(A) < int(B)*f:
        first = "Y"
        break
    else:
        f *= 2
        nokori -= 1
if int(A) < int(B)*f:
        first = "Y"
if first == "Y":
    for o in range(1,nokori+1):
        if int(B)*f < int(C)*s:
            second = "Y"
            break
        else:
            s *= 2
    if int(B)*f < int(C)*s:
            second = "Y"
        
if first == "Y" and second == "Y":
    print("Yes")
else:
    print("No")
print(6-input()-input())

### FIXED CODE ###

A = int(input())
B = int(input())
print(6 - A - B)
N = int(input())
C = dict()
i, cp, lr = 0, 0, []
for _ in range(N):
    c = int(input())
    if c != cp:
        if c in C.keys():
            lr.append([C[c], i])
        C[c] = i
        cp = c
        i += 1
lr.sort()
hist, add, i, ans = [0] * N, [0] * N, 0, 0
for l, r in lr:
    while i <= l:
        hist[i] = hist[i-1] + add[i]
        ans += add[i]
        i += 1
    add[r] += hist[l] + 1
for i in range(l+1, N):
    ans += add[i]
print(ans+1)

### FIXED CODE ###

N = int(input())
C = dict()
i, cp, hist, ans = 0, 0, [0]*N, 0
for _ in range(N):
    c = int(input())
    if c != cp:
        if c in C.keys():
            temp = hist[C[c]] + 1
            hist[i] = hist[i-1] + temp
            ans += temp
        else:
            hist[i] += hist[i-1]
        C[c], cp = i, c
        i += 1
print((ans+1) % (10**9+7))
from math import ceil
a, b = map(int, input().split())
(a + b) / 2 = x
print(ceil(x))

### FIXED CODE ###

import math
a,b = map(int, input().split())
x = (a + b) / 2
print(math.ceil(x))
N, M = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(N)]
y = [list(map(int, input().split())) for _ in range(M)]
for a,b in ab:
    z = [abs(a-c) + abs(b-d) for c,d in cd]
    print(z.index(min(z))+1)

### FIXED CODE ###

N, M = map(int, input().split())
# ab = [int(x) for _ in range(N) for x in input().split()]
ab = [list(map(int, input().split())) for _ in range(N)]
cd = [list(map(int, input().split())) for _ in range(M)]

for st in range(len(ab)):
    dis = [abs(ab[st][0] - cd[cp][0]) + abs(ab[st][1] - cd[cp][1])  for cp in range(len(cd))]
    print(dis.index(min(dis))+1)
n,m = list(map(int, input().split()))
a = []
b = []
for _ in range(m):
    aa, bb = list(map(int, input().split()))
    a.append(aa-1)
    b.append(bb-1)

a = a[::-1]
b = b[::-1]

ans = int(n * (n - 1) /2)
ans_rec = [ans]

p = [-1 for i in range(n)]
size = [1 for i in range(n)]

def find(x):
#     print(x, p[x])
    px = p[x]
    if px <0:
        return x
    else:
        pxx = find(px)
        p[x] = pxx
        return pxx

for k in range(m-1):
    pa = find(a[k])
    pb = find(b[k])
    if pa == pb:
        pass
    else:
        ans -= size[pa] * size[pb]
        size[pa] += size[pb]
        p[pb] = pa
    ans_rec.append(ans)
for a in ans_rec[::-1]:
    print(a)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline
 
N, M = map(int, input().split())
X = []
for _ in range(M):
    a, b = map(int, input().split())
    X.append((a-1, b-1))
X = X[::-1]
    
P = [-1] * N
CT = [1] * N
def pr(i):
    if P[i] < 0:
        return i
    t = pr(P[i])
    P[i] = t
    return t
 
ANS = [0] * M
ans = N * (N-1) // 2
ANS[-1] = ans
for m in range(M-1):
    a, b = X[m]
    pa = pr(a)
    pb = pr(b)
    
    if pa != pb:
        ans -= CT[pa] * CT[pb]
        P[pa] = pb
        CT[pb] += CT[pa]
 
    ANS[-m-2] = ans
 
for a in ANS:
    print(a)
a = input()
b = input()
h = input()
ret = ((a + b ) * h) / 2
print(ret)

### FIXED CODE ###

a = int(input())
b = int(input())
h = int(input())
ret = ((a + b ) * h) / 2
print(int(ret))
import math

a, b, c, d = map(int, input().split())
c, d = min(c,d), max(c, d)

ans = b - a + 1 

if d%c == 0:#4 8 4 2
    ans -= b//c - a//c + (0 if a%c != 0 else 1)

else:
    x = b // c - a//c + (0 if a%c != 0 else 1)
    y = b // d - a//d + (0 if a%d != 0 else 1)

    lcm = c*d//math.gcd(c,d)
    t = b //lcm - a//lcm + (1 if a >= lcm and a%lcm ==0 else 0)

    ans = ans -x-y+t
#    print(x,y,t,lcm,ans)

#    ans += t 


print(ans)

### FIXED CODE ###


import fractions

a, b, c, d = map(int, input().split())
c, d = min(c,d), max(c, d)

ans = b - a + 1 

if d%c == 0:#4 8 4 2
    ans -= b//c - a//c + (0 if a%c != 0 else 1)

else:
    x = b // c - a//c + (0 if a%c != 0 else 1)
    y = b // d - a//d + (0 if a%d != 0 else 1)

    lcm = c*d // fractions.gcd(c,d)
    t = b //lcm - a//lcm + (1 if a >= lcm and a%lcm ==0 else 0)

    ans = ans -x-y+t
#    print(x,y,t,lcm,ans)

#    ans += t 


print(ans)
N, K = map(int, input().split())
A = list( map(int, input().split()) ) #ここでN個受け取る

flags = [0] * 21000
nums = [0] * 21000

for i in range(N):
    flags[A[i]] = 1
    nums[A[i]] += 1
    
s_nums = sorted(nums)
count = 0
ans = 0

if sum(flags) - K > 0:
    for j in range(len(s_nums)):
        if count < sum(flags)-K:
            ans += s_nums[j]
            count += 1
            
    print(ans)
    
else :
    print(0)


### FIXED CODE ###

N, K = map(int, input().split())
A = list( map(int, input().split()) ) #ここでN個受け取る

var = [0] * (N+1)


for i in A:
    var[i] += 1
    
var = sorted(var,  reverse = True )


count = 0
for j in range( K, N+1 ):
    if var[j] == 0:
        break
    
    if var[j] != 0:
        count += var[j]
        
print(count)
from math import *

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

def calc(a, b, c):
	r = sqrt(a)

	ans = a * b * c
	for i in range(max(1, r - 5), min(r + 5, a - 1) + 1):
		v1 = i * b * c
		v2 = (a - i) * b * c
		ans = min(ans, abs(v1 - v2))

	return ans

res = a * b * c

res = min(res, calc(a, b, c))
res = min(res, calc(a, c, b))
res = min(res, calc(b, a, c))
res = min(res, calc(b, c, a))
res = min(res, calc(c, a, b))
res = min(res, calc(c, b, a))

print(res)

### FIXED CODE ###

from math import *

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

def calc(a, b, c):
	r = a // 2

	ans = a * b * c
	for i in range(max(1, r - 5), min(r + 5, a - 1) + 1):
		v1 = i * b * c
		v2 = (a - i) * b * c
		ans = min(ans, abs(v1 - v2))

	return ans

res = a * b * c

res = min(res, calc(a, b, c))
res = min(res, calc(a, c, b))
res = min(res, calc(b, a, c))
res = min(res, calc(b, c, a))
res = min(res, calc(c, a, b))
res = min(res, calc(c, b, a))

print(res)
K = int(input())
S = input()
X = len(S)
mod = 10**9+7

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 = 3*10**6
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 )

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod

ans = 0
for i in range(X,K+X+1):
    A = i-X
    B = K+X-i
    temp *= cmb(A+X-1,X-1,mod)*power(25,A,mod)
    temp %= mod
    temp *= power(26,B,mod)
    ans += temp
    ans %= mod
print(ans)

### FIXED CODE ###

K = int(input())
S = input()
X = len(S)
mod = 10**9+7

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 = 2*10**6
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 )

def power(n, r, mod):
    if r == 0: return 1
    if r%2 == 0:
        return power(n*n % mod, r//2, mod) % mod
    if r%2 == 1:
        return n * power(n, r-1, mod) % mod


A = 0
B = K
temp = cmb(A+X-1,X-1,mod)*power(25,A,mod)
temp %= mod
temp *= power(26,B,mod)
temp %= mod

ans = temp

for i in range(X+1,K+X+1):

    temp *= 25
    temp %= mod
    
    temp *= pow(26, mod-2, mod)
    temp %= mod
    
    temp *= i-1
    temp %= mod
    
    temp *= pow(i-X, mod-2, mod)
    temp %= mod    

    ans += temp
    ans %= mod

print(ans)
n, i = map(int, input())
print(n - i + 1)


### FIXED CODE ###

n, i = map(int, input().split())
print(n - i + 1)
s=input()
if s[3]=s[4] and s[5]=s[6]
 print("Yes")
else
 print("No")

### FIXED CODE ###

s = input()
if s[2] == s[3] and s[4] == s[5]:
  print("Yes")
else:
  print("No")
from sys import stdin
from collections import deque
N,M,K=list(map(int,input().split()))
friend_list=[[] for i in range(N+1)]
block_list=[[] for i in range(N+1)]
def friend_tansaku(i,j):
    color[j]="gray"
    for friend in friend_list[j]:
        if color[friend]=="white":
            if friend not in block_list[i] and friend not in candidate and friend not in friend_list[i]:
                candidate.append(friend)
            friend_tansaku(i,friend)
    color[j]="black"




for i in range(M):
   a,b= list(map(int, input().split()))
   friend_list[a].append(b)
   friend_list[b].append(a)
for i in range(K):
    a, b = list(map(int, input().split()))
    block_list[a].append(b)
    block_list[b].append(a)
for i in range(1,N+1):
    color = ["white"] * (N + 1)
    candidate=[]
    friend_tansaku(i,i)
    if i==N:print(len(candidate))
    else:print(len(candidate),end=" ")

### FIXED CODE ###

from sys import stdin
import sys
import copy
sys.setrecursionlimit(200000)
N,M,K=list(map(int,input().split()))
counter=[[None,None] for i in range(N+1)]
friend_list=[set() for _ in range(N+1)]
block_list=[set() for _ in range(N+1)]
def friend_tansaku(i,j):
    color.add(j)
    cnt[0]+=1
    for friend in friend_list[j]:
        if friend not in color :
            friend_tansaku(i,friend)





for _ in range(M):
   a,b= list(map(int, input().split()))
   friend_list[a].add(b)
   friend_list[b].add(a)
for _ in range(K):
    a, b = list(map(int, input().split()))
    block_list[a].add(b)
    block_list[b].add(a)
for i in range(1,N+1):
    cnt=[0]
    color =set()
    if counter[i][0] is None:
        friend_tansaku(i,i)
        cnt=cnt[0]
        for aa in color:
            counter[aa]=[color,cnt]
    color,cnt =counter[i][0],counter[i][1]
    for k in block_list[i]:
        if k not in color:
            cnt+=1

    count=cnt-(len(friend_list[i])+len(block_list[i]))-1
    if i==N:print(count)
    else:print(count,end=" ")
# def main():
#     n = int(input())
#     al = list(map(int, input().split()))
#     all_xor = 0
#     for a in al:
#         all_xor = all_xor ^ a

#     ans = []
#     for a in al:
#         curr_ans = all_xor ^ a
#         ans.append(curr_ans)

#     print(*ans)


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


N_MAX = 2*(10**6)
MOD = 10**9 + 7
fac, finv, inv = [0]*N_MAX ,[0]*N_MAX, [0]*N_MAX
def com_init():
    fac[0], fac[1] = 1, 1
    finv[0], finv[1] = 1, 1
    inv[1] = 1
    for i in range(2, N_MAX):
        fac[i] = fac[i - 1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * (MOD // i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD

def com(n, k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD


def com(n, k):
    ans = 1
    for i in range(n-k+1,n+1):
        ans *= i
        ans %= MOD
    return (ans * finv[k]) % MOD


def main():
    k = int(input())
    s = input()
    n = len(s)

    com_init()

    ans = 0
    for i in range(0,n):
        ans += (pow(25,k-i,MOD) * pow(26,i,MOD))*com(n+k-i-1,k-1)

    print(ans%MOD)


if __name__ == "__main__":
    main()

### FIXED CODE ###



# def main():
#     n = int(input())
#     al = list(map(int, input().split()))
#     all_xor = 0
#     for a in al:
#         all_xor = all_xor ^ a

#     ans = []
#     for a in al:
#         curr_ans = all_xor ^ a
#         ans.append(curr_ans)

#     print(*ans)


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


N_MAX = 2*(10**6)
MOD = 10**9 + 7
fac, finv, inv = [0]*N_MAX ,[0]*N_MAX, [0]*N_MAX
def com_init():
    fac[0], fac[1] = 1, 1
    finv[0], finv[1] = 1, 1
    inv[1] = 1
    for i in range(2, N_MAX):
        fac[i] = fac[i - 1] * i % MOD
        inv[i] = MOD - inv[MOD%i] * (MOD // i) % MOD
        finv[i] = finv[i - 1] * inv[i] % MOD

def com(n, k):
    if n < k: return 0
    if n < 0 or k < 0: return 0
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD


def main():
    k = int(input())
    s = input()
    n = len(s)

    com_init()

    ans = 0
    for i in range(0,k+1):
        ans += (pow(25,k-i,MOD) * pow(26,i,MOD))*com(n+k-i-1,n-1)

    print(ans%MOD)


if __name__ == "__main__":
    main()
n,k=map(int,input().split())
h=list(map(int,input().split()))
lst=[10001]*(n+1)
lst[0]=0
for i in range(1,n+1):
  for j in range(1,k+1):
    if lst[i]>lst[max(0,i-j)]+abs(h[i]-h[max(0,i-j)]):
      lst[i]=lst[max(0,i-j)]+abs(h[i]-h[max(0,i-j)])
print(lst[n])
    
  


### FIXED CODE ###

import sys
n,k=map(int,input().split())
h=list(map(int,input().split()))
c=[float('inf')]*n
def sub(l):
  return(abs(l-h[0]))
if n-1<=k:
  lst=list(map(sub,h))
  del lst[0]
  print(min(lst))
  sys.exit()  
c[0]=0
m=n-k
for i in range(m):
  for j in range(1,k+1):
    c[i+j]=min(c[i+j],c[i]+abs(h[i+j]-h[i]))
    
for i in range(n-k,n-1):
  for j in range(1,n-i):
    c[i+j]=min(c[i+j],c[i]+abs(h[i+j]-h[i]))
print(c[n-1])
S = input()
l = len(S)// 2
ans= 0 

for i in range(l)
    if  S[i] != S[l-i]:
        ans += 1

print(ans)


### FIXED CODE ###

S = input()
l = len(S)// 2
ans= 0 

for i in range(l):
    if  S[i] != S[-(i+1)]:
        ans += 1

print(ans)
A, op, B = map(int, input().split())
if op == '+':
    print(A+B)
else:
    print(A-B)

### FIXED CODE ###

# ABC50_A

a, op, b = map(str,input().split())
if op == '+':
    print(int(a)+int(b))
else:
    print(int(a)-int(b))
a,b = int(input())
Z = a*b:
  print(Z)

### FIXED CODE ###

a,b =map(int,input().split())
if 1 <= a <=100 and 1 <= b <= 100:
     print(a*b)
s = input()

list = ['Sunny', 'Cloudy', 'Rainy']

for item in list:
  if (item == 'Sunny' and input == 'Sunny':
    print 'Cloudy'
  elif item == 'Cloudy' and input == 'Cloudy':
    print 'Rainy'
  elif item = 'Rainy' and input == 'Rainy':
    print 'Sunny'

### FIXED CODE ###

s = input()
 
if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
elif s == 'Rainy':
    print('Sunny')
A,B,T = input().split()
A = int(A)
B = int(B)
T = int(T)
s = int(s)
for X in range(0,20):
  if A*X <= T + 0.5:
    s = B*X
  if A*X >=T + 0.5:
    break
print(s)



### FIXED CODE ###

A,B,T = input().split()
A = int(A)
B = int(B)
T = int(T)
s = 0
for X in range(1,21):
  if A*X <= T + 0.5:
    s = B*X
  if A*X >=T + 0.5:
    break
print(s)
s = str(int(input()))

if 1 <= int(s[0:2]) and int(s[0:2]) <= 12:
    if 1 <= int(s[2:4]) and int(s[2:4]) <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1 <= int(s[2:4]) and int(s[2:4]) <= 12:
        print('YYMM')
    else:
        print('NA')


### FIXED CODE ###

s = input()
i = int(s[:2])
j = int(s[2:])
if 1 <= i and i <= 12:
    if 1 <= j and j <= 12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:    
    if 1 <= j and j <= 12:
        print('YYMM')
    else:
        print('NA')
A, B = map(int,input().split())
print(str(max(A+B, A-B., A*B)))

### FIXED CODE ###

A, B = map(int,input().split())
print(str(max(A+B, A-B, A*B)))
N, K = map(int, input().split())
A = list(map(int, input().split()))

num = 1
l = []
l.append(num)
for i in range(K):
  num = A[num-1]
  if num not in l:
    l.append(num)
  else:
    mod = (K-1-i) % (i+1-(l.index(num)))
    break;
    
for i in range(mod):
  num = A[num-1]
  
print(num)

### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
was = []
tf = [False] * N
place = 1
cnt = 0

while tf[place-1] == False:
  if cnt < K:
    tf[place-1] = True
    was.append(place)
    place = A[place-1]
    cnt += 1
  else:
    print(place)
    break;
else:
  loop = cnt - was.index(place)
  num = (K-cnt) % loop + was.index(place)
  print(was[num])
n, k = map(int, input().split())
a = list(map(int, input().split()))

pos, neg = [], []
zero_count = 0

for x in a:
	if x > 0:
		pos.append(x)
	elif x < 0:
		neg.append(x)
	else:
		zero_count += 1

# max_v = pos[0]
# min_v = neg[0]

# max_p_idx = 1
# max_n_idx = 0
# min_p_idx = 0
# min_n_idx = 1

# for kk in range(1, min(k, len(pos) + len(neg))):
# 	if max_p_idx < len(pos):
# 		max_v 


MOD = 10**9 + 7

if len(pos) >= k:
	pos_res = pos[:k]
	idx = 0
	while idx + 1 < len(neg) and pos_res[k - idx - 1] * pos_res[k - idx - 2] < neg[idx] * neg[idx + 1]:
		idx += 2

	result = 1
	for i in range(idx):
		result = result * neg[i] % MOD

	for i in range(k - idx):
		result = result * pos[i] % MOD

	print(result)

else:
	left = k - len(pos)
	if left > len(neg):
		print(0) 
	else:
		if left % 2 == 0:
			idx = left
			while idx + 1 < len(neg) and pos_res[k - idx - 1] * pos_res[k - idx - 2] < neg[idx] * neg[idx + 1]:
				idx += 2

			result = 1
			for i in range(idx):
				result = result * neg[i] % MOD

			for i in range(k - idx):
				result = result * pos[i] % MOD

			print(result)
		else:
			if zero_count > 0:
				print(0)
			else:
				b = sorted(map(abs, a))
				result = 1
				for i in range(k):
					result = result * b[i] % MOD
				print(result)	

### FIXED CODE ###

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

pos, neg = [], []
zero_count = 0

for x in a:
	if x > 0:
		pos.append(x)
	elif x < 0:
		neg.append(x)
	else:
		zero_count += 1

# max_v = pos[0]
# min_v = neg[0]

# max_p_idx = 1
# max_n_idx = 0
# min_p_idx = 0
# min_n_idx = 1

# for kk in range(1, min(k, len(pos) + len(neg))):
# 	if max_p_idx < len(pos):
# 		max_v 


MOD = 10**9 + 7

neg = list(sorted(neg))
pos = list(reversed(sorted(pos)))

if len(pos) >= k:
	#print('case 1')
	pos_res = pos[:k]
	idx = 0
	while idx + 1 < len(neg) and pos_res[k - idx - 1] * pos_res[k - idx - 2] < neg[idx] * neg[idx + 1]:
		idx += 2

	result = 1
	for i in range(idx):
		result = result * neg[i] % MOD

	for i in range(k - idx):
		result = result * pos[i] % MOD

	print(result)

else:
	#print('case 2')
	left = k - len(pos)	
	if left % 2 == 1:
		if len(pos) > 0:
			left += 1
		else:
			left = 1000000000
	if left > len(neg):
		#print('case 3')
		b = list(sorted(map(abs, a)))
		result = 1
		for i in range(k):
			result = result * b[i] % MOD
		print(-result % MOD)
	else:
		#print("left = ", left)
		idx = left
		pos_shift = 0
		while idx + 1 < len(neg) and pos_shift + 1 < len(pos) and pos[len(pos) - pos_shift - 1] * pos[len(pos) - pos_shift - 2] < neg[idx] * neg[idx + 1]:
			idx += 2
			pos_shift += 2

		result = 1
		for i in range(idx):
			result = result * neg[i] % MOD

		for i in range(k - idx):
			result = result * pos[i] % MOD

		print(result)
N = input()
V_list = list(map(int,input().split()))
C_list = list(map(int,input().split())

diff_list = [v_list[i]-c_list[i] for i in range(n) if v_list[i] - c_list[i] > 0]
print(diff_list)
diff_list.append(0)
print(diff_list)
print(sum(diff_list))

### FIXED CODE ###

n=int(input())
v_list=list(map(int,input().split()))
c_list=list(map(int,input().split()))

diff_list = [v_list[i]-c_list[i] for i in range(n) if v_list[i] - c_list[i] > 0]
diff_list.append(0)
print(sum(diff_list))
N=int(input())
S=input()
ans=N
for i in range(2, N+1):
  sub=[x for x in list(itertools.combinations(S, i)) if len(x) == len(set(x))]
  ans+=len(sub)
print(ans)

### FIXED CODE ###

N=int(input())
S=input()
ans=1
for c in set(S):
  ans *= (S.count(c)+1)
print((ans-1) % (10**9+7))
import sys
N, K = map(int, input().split())

lis = [[] for i in range(N + 1)]

for n in range(N - 1):
    a, b = map(int, input().split())
    lis[a].append(b)
    lis[b].append(a)

MOD = 10 ** 9 + 7

def dfs(pos, from_, K, lis):
    if from_ == -1:
        to_multi = K - 1
    else:
        to_multi = K - 2
    if len(lis[pos]) > K:
        return 0

    ans = 1
    for item in lis[pos]:
        if item != from_:
            ans *= to_multi
            to_multi -= 1
            ans %= MOD
    for item in lis[pos]:
        if item != from_:
            ans *= dfs(item, pos, K, lis)
            ans %= MOD
    
    return ans

K * dfs(1, from_=-1, K=K, lis=lis)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
N, K = map(int, input().split())

lis = [[] for i in range(N + 1)]

for n in range(N - 1):
    a, b = map(int, input().split())
    lis[a].append(b)
    lis[b].append(a)

MOD = 10 ** 9 + 7

def dfs(pos, from_, K, lis):
    if from_ == -1:
        to_multi = K - 1
    else:
        to_multi = K - 2
    if len(lis[pos]) > K:
        return 0

    ans = 1
    for item in lis[pos]:
        if item != from_:
            ans *= to_multi
            to_multi -= 1
            ans %= MOD
    for item in lis[pos]:
        if item != from_:
            ans *= dfs(item, pos, K, lis)
            ans %= MOD
    
    return ans

print(K * dfs(1, from_=-1, K=K, lis=lis) % MOD)
import sys
def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

def maxim(i,char):
    if i<0:
        return 0

    if li[i][char]!=-1:
            ##print('hi')
            ##print(i,char)
            return li[i][char]
    if char==2:
        li[i][2]= max(c[i]+maxim(i-1,1),c[i]+maxim(i-1,0))
        return li[i][2]
    if char==1:
        li[i][1]= max(b[i] + maxim(i - 1, 0), b[i] + maxim(i - 1, 2))
        return li[i][1]
    if char==0:
        li[i][0]= max(a[i] + maxim(i - 1, 1), a[i] + maxim(i - 1, 2))
        return li[i][0]
    if char==3:
        li[i][3]= (max(maxim(i - 1, 2), maxim(i - 1, 1), maxim(i - 1, 0)))
        return li[i][3]
n=int(input())
a, b, c = [], [], []
for _ in range(n):
    x,y,z=get_ints()
    li=[[-1 for i in range(4)]for j in range(n)]
    a.append(x)
    b.append(y)
    c.append(z)
print(maxim(n-1,3))




### FIXED CODE ###


n=int(input())
h=list(map(int,input().split()))
li=[0]*n
li[1]=abs(h[1]-h[0])
for i in range(2,n):
    li[i]=min(li[i-1]+abs(h[i]-h[i-1]),li[i-2]+abs(h[i]-h[i-2]))
##print(li)
print(li[n-1])
a=input()
print("ABC"+int(a))

### FIXED CODE ###

# coding: utf-8
a=input()
print("ABC"+a)