Harryxun/stf_run huggingface dataset:
import bisect

s = input()
t = input()
T = set(t)
s_num = len(s)
t_num = len(T)

# make a dictonary whose keys are the alphabets in t
dict = {}
appearing_times = {}

# when each alphabet in t appears in s
for w in T:
    dict[w] = []
    appearing_times[w] = 0
    index = -1
    while True:
        index = s.find(w, index + 1)
        if index == -1 and appearing_times[w] == 0:
            print(-1)
            exit()
        elif index == -1:
            break
        else:
            dict[w].append(index)
            appearing_times[w] += 1

# how many times s is repeated
count = 0
# 0 <= length <= s_num - 1
s_index = 0
check = 0

for w in t:
    idx = bisect.bisect_left(dict[w], s_index)
    if check == 'done' and s_index == dict[w][idx]:
        idx = idx + 1

    if idx < appearing_times[w]:
        s_index = dict[w][idx]
    else:
        count += 1
        s_index = dict[w][0]

    check = 'done'
print(count * s_num + s_index + 1)


### FIXED CODE ###

import bisect

s = input()
t = input()
T = set(t)
s_num = len(s)
t_num = len(T)

# make a dictonary whose keys are the alphabets in t
dict = {}
appearing_times = {}

# when each alphabet in t appears in s
for w in T:
    dict[w] = []
    appearing_times[w] = 0
    index = -1
    while True:
        index = s.find(w, index + 1)
        if index == -1 and appearing_times[w] == 0:
            print(-1)
            exit()
        elif index == -1:
            break
        else:
            dict[w].append(index)
            appearing_times[w] += 1

# how many times s is repeated
count = 0
# 0 <= length <= s_num - 1
s_index = 0
w_pre = 'none'

for w in t:
    idx = bisect.bisect_left(dict[w], s_index)
    if w == w_pre:
        idx += 1
        if idx == appearing_times[w]:
            count += 1
            idx = 0

    if idx < appearing_times[w]:
        s_index = dict[w][idx]
    else:
        count += 1
        s_index = dict[w][0]
    w_pre = w

print(count * s_num + s_index + 1)
[N,K]=L()

def L():
    return list(map(int, input().split()))
print(N-K+1)

### FIXED CODE ###

def L():
    return list(map(int, input().split()))

[N,K]=L()


print(N-K+1)
import sys
n = int(input())
A = [int(sys.stdin.readline()) for _ in range(n)]
print("second" if all(a[i]%2==0 for i in range(n)) else 'first')

### FIXED CODE ###

import sys
n = int(input())
A = [int(sys.stdin.readline()) for _ in range(n)]
print("second" if all(A[i]%2==0 for i in range(n)) else 'first')
import numpy as np

def main():
    H, W = [int(i) for i in input().split()]
    N = int(input())
    a = [int(i) for i in input().split()]
    
    color_ar = np.zeros((H, W), dtype=np.int32)
    #print(color_ar)
    
    y = 0
    x = 1
    
    for i in range(N):
        t = a[i]
        while t > 0:
            if(np.count_nonzero(color_ar) == 0):
                color_ar[0,0] = i + 1
            else:
                color_ar[y,x] = i + 1
                if((y + 1) % 2 == 0):
                    x -= 1
                else:
                    x += 1
                
                if((x < 0) or (x >= W)):
                    y += 1
                    if(x < 0):
                        x = 0
                    else:
                        x = W - 1
            t -= 1
            
    #print(color_ar)
    for y in range(H):
        for x in range(W):
            print(color_ar[y,x], end="")
        if(y < H -1 ):
            print("\n")
            
if __name__=="__main__":
    main()

### FIXED CODE ###

import numpy as np

def main():
    H, W = [int(i) for i in input().split()]
    N = int(input())
    a = [int(i) for i in input().split()]
    
    color_ar = np.zeros((H, W), dtype=np.int32)
    #print(color_ar)
    
    y = 0
    x = 0
    
    for i in range(N):
        t = a[i]
        while t > 0:
            if(np.count_nonzero(color_ar) == 0):
                color_ar[0,0] = i + 1
                if((y + 1) % 2 == 0):
                    x -= 1
                else:
                    x += 1
                
                if((x < 0) or (x >= W)):
                    y += 1
                    if(x < 0):
                        x = 0
                    else:
                        x = W - 1
                    
            else:
                color_ar[y,x] = i + 1
                if((y + 1) % 2 == 0):
                    x -= 1
                else:
                    x += 1
                
                if((x < 0) or (x >= W)):
                    y += 1
                    if(x < 0):
                        x = 0
                    else:
                        x = W - 1
            t -= 1
            
    #print(color_ar)
    for y in range(H):
        for x in range(W):
            print(color_ar[y,x], end="")
            if(x < W - 1):
                print(" ",end="")
        if(y < H - 1 ):
            print("")
            
if __name__=="__main__":
    main()
r=int(input())
g=int(input())
b=int(input())
 
x=int(r*100+g*10+b)
if(x%4==0):
    print('YES')
else:
    print("NO")

### FIXED CODE ###

a=input()
a=a.split()

r=int(a[0])
g=int(a[1])
b=int(a[2])

x=100*r+10*g+b

if(x%4==0):
    print('YES')
else:
    print('NO')
N = int(input())
D_list = list(map(int,input().split()))
M = int(input())
T_list = list(map(int,input().split()))

dic_T = {}
for i in T_list:
    dic_T[i] = T_list.count(i)

dic_D = {}
for i in D_list:
    dic_D[i] = D_list.count(i)

ans = 'YES'
for k in dic_T:
    if dic_T[k] > dic_D[k]:
        ans = 'NO'
        print(ans)
        break

if ans == 'YES':
    print(ans)





### FIXED CODE ###

N = int(input())
D_list = list(map(int, input().split()))
M = int(input())
T_list = list(map(int, input().split()))

dic_T = {}
for i in T_list:
    if i in dic_T:
        dic_T[i] += 1
    else:
        dic_T[i] = 1

dic_D = {}
for i in D_list:
    if i in dic_D:
        dic_D[i] += 1
    else:
        dic_D[i] = 1

for i in dic_T:
    if i in dic_D:
        if not dic_T[i] <= dic_D[i]:
            print('NO')
            exit()
    else:
        print('NO')
        exit()

print('YES')
from collections import Counter

N = int(input())
S = [input() for _ in range(N)
cl = [Counter(s) for s in S]

ans = ""
for i in range(26):
  s = chr(ord("a")+i)
  val = min([c[s] for c in cl])
  ans += s*val
print(ans)

### FIXED CODE ###

from collections import Counter

N = int(input())
S = [input() for _ in range(N)]
cl = [Counter(s) for s in S]

ans = ""
for i in range(26):
  s = chr(ord("a")+i)
  val = min([c[s] for c in cl])
  ans += s*val
print(ans)
n=int(input())
s = [input() for i in range(n)]
c=0
a=["" for i in range(n)]
for i in range(n):
   b[i]=sorted(s[i])
   a[i]=''.join(b[i])
for i in range(n-1):
    for j in range(i+1,n):
        if a[i]==a[j]:
            c+=1
print(c)

### FIXED CODE ###

N = int(input())
S = [''.join(sorted(input().rstrip())) for _ in range(N)]
 
from collections import Counter
counter = Counter(S)
 
answer = sum(x*(x-1)//2 for x in counter.values())
print(answer)
wd = {
  "SUN":7
  "MON":6
  "TUE":5
  "WED":4
  "THU":3
  "FRI":2
  "SAT":1
  }
line = input()
 
print(wd[line])

### FIXED CODE ###

wd = {
  "SUN":7,
  "MON":6,
  "TUE":5,
  "WED":4,
  "THU":3,
  "FRI":2,
  "SAT":1
  }
line = input()
 
print(wd[line])
tmp = input().split()

if tmp[1] == '+':
  print(tmp[0]+tmp[2])
else:
  print(tmp[0]-tmp[2])

### FIXED CODE ###

tmp = input().split()

if tmp[1] == '+':
  print(int(tmp[0])+int(tmp[2]))
else:
  print(int(tmp[0])-int(tmp[2]))
A = int(input())
B = int(input())
print(max(A+B, A-B, A*B))

### FIXED CODE ###

#137 +-x
A = list(map(int,input().split()))
print(max(A[0]+A[1], A[0]-A[1], A[0]*A[1]))
a, b, c = map(int,input().split())
if c − a − b > (0 and 4 * a * b) < (c − a − b)**2:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a, b, c = map(int,input().split())
if (c - a - b > 0) and (4 * a * b < (c - a - b)**2):
  print('Yes')
else:
  print('No')
x, y = map(int, input().split())
mod = 10 ** 9 + 7

if (x + y) % 3 != 0:
    print(0)
else:
    time = (x + y) // 3
    if time > x or time > y:
        print(0)
    else:
        move_time = sorted([x - time, y - time])
        
        ans = 1
        for i in range(2, time+1):
            ans *= i
            ans %= mod
        
        const = 1
        for i in range(1, move_time[1]+1):
            const *= i
            const %= mod
            
            if i == move_time[0]:
                inv0 = pow(const, mod-2, mod)
            
        inv1 = pow(const, mod-2, mod)
    
        print((ans * inv0 * inv1) % mod)

### FIXED CODE ###

x, y = map(int, input().split())
mod = 10 ** 9 + 7

if (x + y) % 3 != 0:
    print(0)
else:
    time = (x + y) // 3
    if time > x or time > y:
        print(0)
    else:
        move_time = sorted([x - time, y - time])
        
        if move_time[0] == 0:
            print(1)
        else:
            ans = 1
            for i in range(2, time+1):
                ans *= i
                ans %= mod
            
            const = 1
            for i in range(1, move_time[1]+1):
                const *= i
                const %= mod
                
                if i == move_time[0]:
                    inv0 = pow(const, mod-2, mod)
                
            inv1 = pow(const, mod-2, mod)
        
            print((ans * inv0 * inv1) % mod)
def resolve():
    N = int(input())
    import collections
    n_dict = collections.defaultdict(list)
    for i in range(N-1):
        u,v,w = map(int,input().split())
        n_dict[u-1].append((v-1,w))
        n_dict[v-1].append((u-1,w))

    color = [-1 for _ in range(N)]

    def paint(i,c):
        color[i] = c
        for n,w in n_dict[i]:
            if color[n] == -1:
                paint(n,c^1) if w % 2 != 0 else paint(n,c)
            else:
                continue
        return
    for i in range(N):
        if color[i] == -1:
            paint(i,1)   
        print(color[i])
resolve()

### FIXED CODE ###

def resolve():
    N = int(input())
    import collections
    n_dict = collections.defaultdict(list)
    for i in range(N-1):
        u,v,w = map(int,input().split())
        n_dict[u-1].append((v-1,w))
        n_dict[v-1].append((u-1,w))

    color = [-1 for _ in range(N)]

    d = collections.deque()
    for i in range(N):
        if color[i] == -1:
            d.append((i,1))
        while d:
            j,c = d.pop()
            color[j] = c
            for n,w in n_dict[j]:
                if color[n] == -1:
                    d.append((n,c^1)) if w % 2 != 0 else d.append((n,c))
                else:
                    continue
        print(color[i])
resolve()
from functools import reduce
from operator import mul
def prime_factorize_dict(n):
    if n == 1:
        return {1: 1}
    d = dict()
    while not n & 1:
        d[2] = d.get(2, 0) + 1
        n >>= 1
    f = 3
    while f * f <= n:
        if not n % f:
            d[f] = d.get(f, 0) + 1
            n //= f
        else:
            f += 2
    if n != 1:
        d[n] = d.get(n, 0) + 1
    return d

N, P = map(int, input().split())
factors, powers = zip(*((factor, power) for factor, power in prime_factorize_dict(P).items() if power >= N))
print(reduce(mul, (factor ** (min(powers) // N) for factor in factors)))

### FIXED CODE ###

from functools import reduce
from operator import mul
def prime_factorize_dict(n, N):
    d = {1: 1}
    while not n & 1:
        d[2] = d.get(2, 0) + 1
        n >>= 1
    f = 3
    while f * f <= n:
        if not n % f:
            d[f] = d.get(f, 0) + 1
            n //= f
        else:
            f += 2
    if n != 1:
        d[n] = d.get(n, 0) + 1
    return d

N, P = map(int, input().split())
print(reduce(mul, (factor ** (power // N) for factor, power in prime_factorize_dict(P, N).items())))
s = input()
n = len(s)
ct = 0
if len(set(s)) == 1:
  ans = 0
else:
 for i in range(n-1):
  if s[i] != s[i+1]:
    ans+= 1
print(ans)
  

### FIXED CODE ###

s = input()
n = len(s)
ans = 0
if len(set(s)) == 1:
  ans = 0
else:
 for i in range(n-1):
  if s[i] != s[i+1]:
    ans+= 1
print(ans)
a=int(input()) print(a+a*a+a**3)

### FIXED CODE ###

a=input()
a=int(a)
print(a+a*a+a*a*a)
N,K,X,Y=[input() for _ in range(4)]
if N-K>=0:    
    print(X*K+Y*(N-K))
else:
    print(X*N)

### FIXED CODE ###

list=[input() for i in range(4)]
N,K,X,Y=map(int,list)

print(X*K+Y*(N-K) if N > K else X*N)
from collections import deque

def next_char_ascii_num(c, k):
    n = ord(c) + (k % 26)
    if n <= 122:
        return n
    else:
        return n % 123 + 97

s = input()
k = int(input())
d = deque()
l = len(s)

for x in s:

    if k == 0:
        d.append(ord(x))

    else:
        if k >= 25 and l != 1:
            d.append(97)
            k -= (26 - (ord(x) - 97))
        else:
            v =[next_char_ascii_num(x, y) for y in range(k + 1)]
            min_index = v.index(min(v))
            d.append(v[min_index])
            k -= min_index

if k > 0:
    d[-1] = next_char_ascii_num(chr(d[-1]), k)

print("".join([chr(x) for x in d]))


### FIXED CODE ###

s = input()
print(s[:4] + " " + s[4:])
from fractions import gcd
a,b,k = map(int,input().split())
mods = []
for i in range(1,max(a,b)):
    if a % i == 0 and b % i == 0:
        mods.append(i)
print(mods[k-1])

### FIXED CODE ###

a,b,k = map(int,input().split())
cd = []
for i in range(1,min(a,b)+1):
    if a % i == 0:
        if b % i == 0:
            cd.append(i)
cd.sort(reverse=True)
print(cd[k-1])
a, b=map(int, input().split())
2.c=a+b
3.if c<24:
4.  print (c)
5.elif c>=24:
6.  print (c-24)


### FIXED CODE ###

a, b=map(int, input().split())
c=a+b
if c<24:
  print (c)
elif c>=24:
  print (c-24)
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

def calc(p, x, li, ans):
    ans[p] += x
    if len(li[p]) == 0:
        return
    for b in li[p]:
        calc(b, x, li, ans)

n, q = na()
li = [[] for i in range(n+1)]
ans = [0 for i in range(n+1)]

for i in range(n-1):
    a, b = na()
    li[a].append(b)

for i in range(q):
    p, x = na()
    calc(p, x, li, ans)
print(*ans[1:])







### FIXED CODE ###

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

def dfs(v, par):
    for nv in g[v]:
        if nv == par:
            continue
        memo[nv] += memo[v]
        dfs(nv, v)

n, q = na()
g = [deque() for _ in range(n)]
for i in range(n-1):
    a, b = na()
    a -= 1
    b -= 1
    g[a].append(b)
    g[b].append(a)
memo = [0] * n
for i in range(q):
    #seen = [False] * n
    p, x = na()
    p -= 1
    memo[p] += x

dfs(0, -1)
print(*memo)
import numpy as np
n=int(input())
a=[map(int, input().split())]
b=np.array(a)

c=0

while all(b%2==0):
    b=b/2
    c += 1
    
print(c)

### FIXED CODE ###

import numpy as np
n=int(input())
a=map(int, input().split())
b=[]

for i in a:
    b.append(i)

b=np.array(b)
c=0

while all(b%2==0):
    b=b/2
    c += 1
    
print(c)
N, M = map(int, input().split())
price = []
kagi = []
for i in range(M):
  price.append(int(input().split()[0]))
  key = 0
  kagikagi = list(map(int,input().split()))
  for k in kagikagi:
    key += 2 ** (k-1)
  kagi.append(key)

res = -1
for i in range(2**M):
  combi = 0
  tmp_res = 0
  keys = []
  for j in range(M):
    if((i >> j) & 1):
      combi = combi|kagi[j]
      tmp_res += price[j]
      keys.append(j)
  if combi == 2**N-1:
	if tmp_res < res or res == -1:
      res = tmp_res
      
print(res)

### FIXED CODE ###

N, M = map(int, input().split())
price = []
keys = []
dp = [float('inf') for i in range(1<<N)]
dp[0] = 0
for k in range(M):
    price.append(int(input().split()[0]))
    keys.append(list(map(int,input().split())))
for p,key in zip(price,keys):
    key_open = 0
    for k in key:
        key_open |= 1 << (k-1)
        for j in range(1 << N):
            dp[j|key_open] = min(dp[j|key_open], dp[j] + p)

if dp[(1<<N)-1] == float('inf'):
    dp[(1<<N)-1] = - 1
print(dp[(1 << N) - 1])
import sys
sys.setrecursionlimit(10 ** 9)

N, M, Q, *ABCD = map(int, open(0).read().split())

L = list(zip(*[iter(ABCD)] * 4))

def solve(A):
    if len(A) == M:
        return sum(d for a, b, c, d in L if A[b - 1] - A[a - 1] == c)

    return max((solve(A + [i]) for i in range(A[-1], M + 1)), default=0)

print(solve([1]))

### FIXED CODE ###

from itertools import combinations_with_replacement

N, M, Q, *ABCD = map(int, open(0).read().split())

L = list(zip(*[iter(ABCD)] * 4))

print(max(sum(d for a, b, c, d in L if A[b - 1] - A[a - 1] == c) for A in combinations_with_replacement(range(1, M + 1), N)))
N = int(input())
A = list(map(int, input().split()))
M = 100005
cnt = [0]*M
ans = 0
for a in A:
    if cnt[a] != 0:
        cnt[a] = 2
    else:
        for i in range(a, M, a):
            cnt[i] += 1
for a in A:
    if cnt[a] == 1:
        ans += 1
print(ans)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
M = max(A)+1
cnt = [0]*M
ans = 0
for a in A:
    if cnt[a] != 0:
        cnt[a] = 2
    else:
        for i in range(a, M, a):
            cnt[i] += 1
for a in A:
    if cnt[a] == 1:
        ans += 1
print(ans)
# -*- coding: utf-8 -*-

import sys
import os

N, M = list(map(int, input().split()))
students = []
checkpoints = []

for i in range(N):
    a, b = list(map(int, input().split()))
    students.append([a, b])

for i in range(M):
    a, b = list(map(int, input().split()))
    checkpoints.append([a, b])

for student in students:
    min_dist = float('inf')
    min_i = None
    for i, checkpoint in enumerate(checkpoints):
        manhattan_dist = abs(checkpoint[0] - student[0]) + abs(checkpoint[1] - student[1])
        if manhattan_dist < min_dist:
            min_dist = manhattan_dist
            min_i = i
    print(min_i + 1)


### FIXED CODE ###

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

import sys
import os

a, b = list(map(int, input().split()))
c = (a + b) % 24
print(c)
n = int(input())

if int(n[-1]) in [2,4,5,7,9]:
    print("hon")
elif int(n[-1]) in [0, 1, 6, 8]:
    print("pon")
else:
    print("bon")

### FIXED CODE ###

n = int(input())
a = n%10

if a in [2,4,5,7,9]:
    print("hon")
elif a in [0, 1, 6, 8]:
    print("pon")
else:
    print("bon")
n = int(input())
s = []
zyogen = []
kagen = []
for i in range(n):
    k, z = map(int, input().split())
    kagen.append(k)
    zyogen.append(z)

kk = sorted(k)
zz = sorted(z)
if(n % 2 == 0):
    aa = n // 2
    x = kk[aa-1]
    y = zz[aa]
    print(y-x+1)
else:
    aa = n // 2
    x = kk[aa]
    y = zz[aa]
    print(y-x+1)
    

### FIXED CODE ###

n = int(input())
s = []
zyogen = []
kagen = []
for i in range(n):
    k, z = map(int, input().split())
    kagen.append(k)
    zyogen.append(z)

kk = sorted(kagen)
zz = sorted(zyogen)
if(n % 2 == 0):
    aa = n // 2
    x = kk[aa-1] + kk[aa]
    y = zz[aa-1] + zz[aa]
    print(y-x+1)
else:
    aa = n // 2
    x = kk[aa]
    y = zz[aa]
    print(y-x+1)
import operator

di = {}

for i, (a, b, c) in enumerate(zip(a_, b_, c_)):
    di['a{}'.format(i)] = a
    di['b{}'.format(i)] = b
    di['c{}'.format(i)] = c

if len(di) > 3000:
    di = sorted(di.items(), reverse=True, key=operator.itemgetter(1))
    di = di[:3000]


a_li = []
b_li = []
c_li = []

for key, value in di.items():
    if 'a' in key:
        a_li.append(value)
    elif 'b' in key:
        b_li.append(value)
    elif 'c' in key:
        c_li.append(value)

ans = []
for a in a_li:
    for b in b_li:
        for c in c_li:
            ans.append(a+b+c)

ans.sort(reverse=True)

if len(ans) > 3000:
    for count, i in enumerate(ans):
        print(i)
        if count==2999:
            break
else:
    for count, i in enumerate(ans):
        print(i)

### FIXED CODE ###

x, y, z, k = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

ABC = []
for x, a in enumerate(A):
    if x+1 > 3000:
        break
        
    for y, b in enumerate(B):
        if (x+1)*(y+1) > 3000:
            break
    
        for z, c in enumerate(C):
            if (x+1)*(y+1)*(z+1) > 3000:
                break
            
            ABC.append(a+b+c)
            
ABC.sort(reverse=True)
ABC = ABC[:k]

for abc in ABC:
    print(abc)
n, k = map(int, input().split())
print((n - 2) // (k - 2) + 1)


### FIXED CODE ###

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

if n == k:
    print(1)
else:
    i = 0
    for i, a in enumerate(map(int, input().split())):
        if a == 1:
            break
    left = (i - 1) // (k - 1) + 1
    lr = (k - 1) * left + 1
    print(left + (n - lr - 1) // (k - 1) + 1)
import sys
def input(): return sys.stdin.readline().rstrip()
def f(n,x):#レベルnのx番目
    if n==0:return 0 if x<=0 else 1
    if x<=1+A[n-1]:return f(n-1,x-1)
    if x<=2*A[n-1]+2:return 1+P[n-1]+f(n-1,x-A[n-1]-2)
def main():
    n,x=map(int,input().split())
    global A,P
    A=[1, 5, 13, 29, 61, 125, 253, 509, 1021, 2045, 4093, 8189, 16381, 32765, 65533, 131069, 262141, 524285, 1048573, 2097149, 4194301, 8388605, 16777213, 33554429, 67108861, 134217725, 268435453, 536870909, 1073741821, 2147483645, 4294967293, 8589934589, 17179869181, 34359738365, 68719476733, 137438953469, 274877906941, 549755813885, 1099511627773, 2199023255549, 4398046511101, 8796093022205, 17592186044413, 35184372088829, 70368744177661, 140737488355325, 281474976710653, 562949953421309, 1125899906842621, 2251799813685245, 4503599627370493]
    P=[1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 2147483647, 4294967295, 8589934591, 17179869183, 34359738367, 68719476735, 137438953471, 274877906943, 549755813887, 1099511627775, 2199023255551, 4398046511103, 8796093022207, 17592186044415, 35184372088831, 70368744177663, 140737488355327, 281474976710655, 562949953421311, 1125899906842623, 2251799813685247]
    print(f(n,x))

if __name__=='__main__':
    main()

### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().rstrip()
def f(n,x):#レベルnのx番目
    if n==0:return 0 if x<=0 else 1
    if x<=1+A[n-1]:return f(n-1,x-1)
    return 1+P[n-1]+f(n-1,x-A[n-1]-2)
def main():
    n,x=map(int,input().split())
    global A,P
    A=[1, 5, 13, 29, 61, 125, 253, 509, 1021, 2045, 4093, 8189, 16381, 32765, 65533, 131069, 262141, 524285, 1048573, 2097149, 4194301, 8388605, 16777213, 33554429, 67108861, 134217725, 268435453, 536870909, 1073741821, 2147483645, 4294967293, 8589934589, 17179869181, 34359738365, 68719476733, 137438953469, 274877906941, 549755813885, 1099511627773, 2199023255549, 4398046511101, 8796093022205, 17592186044413, 35184372088829, 70368744177661, 140737488355325, 281474976710653, 562949953421309, 1125899906842621, 2251799813685245, 4503599627370493]
    P=[1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215, 33554431, 67108863, 134217727, 268435455, 536870911, 1073741823, 2147483647, 4294967295, 8589934591, 17179869183, 34359738367, 68719476735, 137438953471, 274877906943, 549755813887, 1099511627775, 2199023255551, 4398046511103, 8796093022207, 17592186044415, 35184372088831, 70368744177663, 140737488355327, 281474976710655, 562949953421311, 1125899906842623, 2251799813685247]
    print(f(n,x))

if __name__=='__main__':
    main()
a = int(input())
b = list(input())
c = int(input())
for i in range(a):
  if b[i] != b[c]:
    b[i] = "*"
print("".join(b))
    


### FIXED CODE ###

a = int(input())
b = list(input())
c = int(input())
for i in range(a):
  if b[i] != b[c-1]:
    b[i] = "*"
print("".join(b))
n = int(input())
a = [int(i) for i in input().split()]
if(max(a) > (sum(a) - max(a)):
   print("NO")
else:
   print("YES")

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
if(max(a) >= (sum(a) - max(a))):
   print("No")
else:
   print("Yes")