Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = lambda: sys.stdin.readline().rstrip() 

def resolve():
    N = int(input())
    K = int(input())

    counter = [0, 0, 0, 0]
    for i in range(1, N+1):
        cnt = len(str(i)) - str(i).count('0')
        if cnt <= 3:
            counter[cnt] += 1
    print(counter[K])


if __name__ == '__main__':
    resolve()


Fixed submission:
import bisect, collections, copy, functools, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    K = I()

    # [0, N]で、non0の数字がK個あるものの数
    @functools.lru_cache
    def f(N, K):
        if N == K == 0:
            ret = 1
        elif N > 0 and K >= 0:
            ret = f(N // 10, K) + N % 10 * f(N // 10, K - 1) + (9 - N % 10) * f(N // 10 - 1, K - 1)
        else:
            ret = 0
        return ret
    
    ans = f(N, K)
    print(ans)

if __name__ == '__main__':
    resolve()
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
 
H, N = map(int, input().split())
A = list(map(int, input().split()))
 
ans = 'No'
 
for i in itertools.product([True, False], repeat=N):
    if sum([A[j] for j in range(len(A)) if i[j]]) == H:
        ans = 'Yes'
print(ans)

Fixed submission:
H, N = map(int, input().split())
A = list(map(int, input().split()))

total = sum(A)
if total >= H:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

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

ans = 'No'

for i in itertools.product([True, False], repeat=N):
    if sum([A[j] for j in range(len(A)) if i[j]]) == H:
        ans = 'Yes'
print(ans)

Fixed submission:
H, N = map(int, input().split())
A = list(map(int, input().split()))

total = sum(A)
if total >= H:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
XL = [list(map(int, input().split())) for _ in range(N)]

XL = sorted(XL, key=lambda x: x[0]+x[1])

ans = [0]
for i in range(1, N):
    can_put = True
    for j in ans:
        # ぶつかった場合
        if XL[i][0] - XL[i][1] < XL[j][0] + XL[j][1] and XL[j][0] - XL[j][1] < XL[i][0] + XL[i][1]:
            can_put = False
    if can_put:
        ans.append(i)

print(len(ans))

Fixed submission:
N = int(input())
XL = [list(map(int, input().split())) for _ in range(N)]

XL = sorted(XL, key=lambda x: x[0]+x[1])

ans = 1
right = XL[0][0] + XL[0][1]

for i in range(1, N):
    if right <= XL[i][0] - XL[i][1]:
        right = XL[i][0] + XL[i][1]
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
XL = [list(map(int, input().split())) for _ in range(N)]

X = [XL[i][0] for i in range(N)]
L = [XL[i][1] for i in range(N)]

# ぶつかるものを挙げる
def hit(x_ids, in_x_id):
    ans = []
    for i in x_ids:
        # print(X[in_x_id] - L[in_x_id], X[i] + L[i], X[i] - L[i], X[in_x_id] + L[in_x_id])
        if X[in_x_id] - L[in_x_id] < X[i] + L[i] and X[i] - L[i] < X[in_x_id] + L[in_x_id]:
            # print('haitta')
            ans.append(i)
    return ans


# n番目までの入れ方全パターン
dp = [[] for _ in range(N)]
dp[0].append([0])

for i in range(1, N):
# i-1番目まで見たときの最大個数のパターンに
    for j in dp[i-1]:
# i番目のを追加してもぶつからなければ追加
        hitlist = hit(j, i)
        # print('i, j:', i, j)
        # print(hitlist)
        if len(hitlist) == 0:
            dp[i].append(j+[i])
        else:
# ぶつかるなら、i番目を入れないパターンがある
            dp[i].append(j)
# i番目とぶつかるやつが1個ならそれを消してn番目を入れるパターンもある
            if len(hitlist) == 1:
                dp[i].append(j[: hitlist[0]] + j[hitlist[0] :] + [i])

print(len(dp[-1][0]))


Fixed submission:
N = int(input())
XL = [list(map(int, input().split())) for _ in range(N)]

XL = sorted(XL, key=lambda x: x[0]+x[1])

ans = 1
right = XL[0][0] + XL[0][1]

for i in range(1, N):
    if right <= XL[i][0] - XL[i][1]:
        right = XL[i][0] + XL[i][1]
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys, fractions
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def lcm_list(a):
    if len(a)==2:
        return a[0]*a[1]//fractions.gcd(a[0], a[1])
    else:
        tmp = lcm_list(a[:-1])
        return tmp*a[-1]//fractions.gcd(tmp, a[-1])

def resolve():
    N, M = LI()
    a = LI()

    a_half = [i//2 for i in a]
    a_half_lcm = lcm_list(a_half)
    has_scm = not 0 in [a_half_lcm//i%2 for i in a_half]

    if has_scm:
        print((M-a_half_lcm)//(2*a_half_lcm)+1)
    else:
        print(0)

if __name__ == '__main__':
    resolve()

Fixed submission:
from functools import reduce
import fractions
import numpy as np

N, M = map(int, input().split())
a = np.array(list(map(int, input().split())))

a = a // 2

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

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

l = lcm(*a)
exist = not 0 in ((l//a)%2)

if exist:
    print((M // l + 1 ) // 2)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
MOD = 1000000007
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    N = I()
    A = LI()

    # color_number[i][j]: [0, i)でj番目に多い色の人数
    color_number = [[0, 0, 0] for _ in range(N)]
    for i in range(N-1):
        idx = color_number[i].index(A[i])
        for j in range(3):
            if j==idx:
                color_number[i+1][j] = color_number[i][j] + 1
            else:
                color_number[i+1][j] = color_number[i][j]

    ans = 1
    for i in range(N):
        ans *= color_number[i].count(A[i])
        ans %= MOD

    print(ans)

if __name__ == '__main__':
    resolve()

Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
MOD = 1000000007
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    N = I()
    A = LI()

    # color_number[i][j]: [0, i)でj番目に多い色の人数
    color_number = [[0, 0, 0] for _ in range(N)]
    for i in range(N-1):
        if A[i] in color_number[i]:
            idx = color_number[i].index(A[i])
        else:
            idx = -1
        for j in range(3):
            if j==idx:
                color_number[i+1][j] = color_number[i][j] + 1
            else:
                color_number[i+1][j] = color_number[i][j]

    ans = 1
    for i in range(N):
        ans *= color_number[i].count(A[i])
        ans %= MOD

    print(ans)

if __name__ == '__main__':
    resolve()
Buggy python submission (verdict: Runtime Error):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W, K = LI()
    s = [SS() for _ in range(W)]

    ans = [[0] * W for _ in range(H)]
    cnt = 1
    for i in range(H):
        is_first = True
        for j in range(W):
            if s[i][j] == '#':
                if is_first:
                    is_first = False
                else:
                    cnt += 1
            ans[i][j] = cnt
        cnt += 1

    for i in ans:
        print(*i)

if __name__ == '__main__':
    resolve()


Fixed submission:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W, K = LI()
    s = [SS() for _ in range(H)]

    ans = [[0] * W for _ in range(H)]

    # 行ごとにいちごで区切って塗り分け
    cnt = 1
    for i in range(H):
        is_first = True
        if s[i].count("#") >= 1:
            for j in range(W):
                if s[i][j] == '#':
                    if is_first:
                        is_first = False
                    else:
                        cnt += 1
                ans[i][j] = cnt
            cnt += 1

    # いちごなし行の場合、前の行の値をコピー
    first_strawberry_row = -1
    for i in range(H):
        if s[i].count("#") >= 1:
            first_strawberry_row = i
            break

    for i in range(first_strawberry_row, H):
        if s[i].count("#") == 0:
            for j in range(W):
                ans[i][j] = ans[i-1][j]

    # 前にコピー元がない場合、後ろの行からコピー
    for i in range(first_strawberry_row):
        r = first_strawberry_row - 1 - i
        if s[r].count("#") == 0:
            for j in range(W):
                ans[r][j] = ans[r+1][j]

    for i in ans:
        print(*i)

if __name__ == '__main__':
    resolve()
Buggy python submission (verdict: Runtime Error):
import sys, math
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    a, b, x = LI()

    if 2*x<(a**2)*b:
        ans = 90 - math.degrees(math.atan(2*x / (a*(b**2))))
    else:
        ans = 90 - math.degrees(math.atan(a**3 / (2*((a**2)*b-x))))
    print(ans)

if __name__ == '__main__':
    resolve()

Fixed submission:
import sys, math
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    a, b, x = LI()

    if 2*x<(a**2)*b:
        ans = 90 - math.degrees(math.atan(2*x / (a*(b**2))))
    elif (a**2)*b == x:
        ans = 0
    else:
        ans = 90 - math.degrees(math.atan(a**3 / (2*((a**2)*b-x))))
    print(ans)

if __name__ == '__main__':
    resolve()
Buggy python submission (verdict: Time Limit Exceeded):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    s = [SS() for _ in range(N)]

    cnt = [collections.Counter(i) for i in s]
    
    ans = 0
    for i, j in itertools.combinations(cnt, 2):
        if i == j:
            ans += 1

    print(ans)

if __name__ == '__main__':
    resolve()


Fixed submission:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    s = [''.join(sorted(list(SS()))) for _ in range(N)]

    cnt = collections.Counter(s)
    ans = sum([i * (i - 1) // 2 for i in cnt.values()])

    print(ans)

if __name__ == '__main__':
    resolve()
Buggy python submission (verdict: Time Limit Exceeded):
import sys, bisect
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def lis(a, colored):
    L = []
    L_idx = []
    ret = []
    for i, e in enumerate(a):
        if not colored[i]:
            idx = bisect.bisect_left(L, e)
            if idx==len(L):
                if len(L)>0:
                    ret.append(L_idx[-1])
                L.append(e)
                L_idx.append(i)
            else:
                idx = max(idx, 0)
                L[idx] = e
                L_idx[idx] = i
    ret.append(L_idx[-1])
    return ret

def resolve():
    N = I()
    A = [I()-1 for _ in range(N)]

    colored = [False]*N
    ans = 0
    while colored.count(False)>0:
        group = lis(A, colored)
        for i in group:
            colored[i] = True
        ans += 1

    print(ans)

if __name__ == '__main__':
    resolve()


Fixed submission:
import sys, bisect
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def lis_(a):
    dp = [INF]*len(a)
    for i in a:
        dp[bisect.bisect_left(dp, i+1)] = i
    return bisect.bisect_left(dp, INF)

def resolve():
    N = I()
    A = [I() for _ in range(N)]
    A = A[::-1]

    print(lis_(A))

if __name__ == '__main__':
    resolve()
Buggy python submission (verdict: Runtime Error):
from e import resolve
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """5 3"""
        output = """5
4 3
1 2
3 1
4 5
2 3"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """5 8"""
        output = """-1"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """5 1"""
        output = """-1"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """5 0"""
        output = """-1"""
        self.assertIO(input, output)


if __name__ == "__main__":
    unittest.main()


Fixed submission:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, K = LI()

    # Kの上界として、全ての頂点対の数がある。
    # グラフが連結なので頂点数-1個の頂点対は最短距離1になる。
    # よってKの最大値はNC2-(N-1)
    max_K = N * (N - 1) // 2 - (N - 1)
    if K <= max_K:
        # Kが最大値を取るのはスター型
        # そこから葉同士をくっつけて減らしていく
        print((N - 1) + max_K - K)
        for i in range(1, N):
            print(i, N)
        cnt = max_K
        for i, j in itertools.combinations(range(1, N), 2):
            if cnt == K:
                break
            print(i, j)
            cnt -= 1
    else:
        print(-1)

if __name__ == '__main__':
    resolve()
Buggy python submission (verdict: Runtime Error):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    xy = [LI() for _ in range(N)]

    interval = []
    for i in range(N):
        for j in range(N):
            if i != j:
                interval.append((xy[i][0] - xy[j][0], xy[i][1] - xy[j][1]))

    cnt = collections.Counter(interval)
    nocost = max(cnt.values())
    ans = N - nocost
    print(ans)

if __name__ == '__main__':
    resolve()


Fixed submission:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    xy = [LI() for _ in range(N)]

    if N == 1:
        print(1)
    else:
        interval = []
        for i in range(N):
            for j in range(N):
                if i != j:
                    interval.append((xy[i][0] - xy[j][0], xy[i][1] - xy[j][1]))

        cnt = collections.Counter(interval)
        nocost = max(cnt.values())
        ans = N - nocost
        print(ans)

if __name__ == '__main__':
    resolve()
Buggy python submission (verdict: Runtime Error):
import sys
input = lambda: sys.stdin.readline().rstrip() 

def resolve():
    N = int(input())
    SP = [input().split() for _ in range(N)]

    SP = enumerate(SP)
    SP = sorted(SP, key=lambda x: (x[1][1], -x[1][0]))
    for i in SP:
        print(i[0])    

if __name__ == '__main__':
    resolve()


Fixed submission:
import sys
input = lambda: sys.stdin.readline().rstrip() 

def resolve():
    N = int(input())
    SP = [input().split() for _ in range(N)]

    SP = enumerate(SP)
    SP = sorted(SP, key=lambda x: (x[1][0], -int(x[1][1])))
    for i in SP:
        print(i[0]+1)    

if __name__ == '__main__':
    resolve()
Buggy python submission (verdict: Time Limit Exceeded):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W = LI()
    A = [SS() for _ in range(H)]

    d = ((1, 0), (0, 1), (-1, 0), (0, -1))

    dist = [[INF] * W for i in range(H)]
    que = collections.deque()

    for i, j in itertools.product(range(H), range(W)):
        if A[i][j] == '#':
            que.append((i, j))
            dist[i][j] = 0

    while que:
        cy, cx = que.popleft()
        for dy, dx in d:
            ny = cy + dy
            nx = cx + dx
            if 0 <= ny < H and 0 <= nx < W and dist[cy][cx] + 1 < dist[ny][nx]:
                dist[ny][nx] = dist[cy][cx] + 1
                que.append((ny, nx))

    # for i in dist:
    #     print(i)

    ans = max([max(i) for i in dist])
    print(ans)

if __name__ == '__main__':
    resolve()


Fixed submission:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    H, W = LI()
    A = [SS() for _ in range(H)]

    d = ((1, 0), (0, 1), (-1, 0), (0, -1))

    dist = [[INF] * W for i in range(H)]
    que = collections.deque()

    for i, j in itertools.product(range(H), range(W)):
        if A[i][j] == '#':
            que.append((i, j))
            dist[i][j] = 0

    while que:
        cy, cx = que.popleft()
        for dy, dx in d:
            ny = cy + dy
            nx = cx + dx
            if 0 <= ny < H and 0 <= nx < W and dist[cy][cx] + 1 < dist[ny][nx]:
                dist[ny][nx] = dist[cy][cx] + 1
                que.append((ny, nx))

    # for i in dist:
    #     print(i)

    ans = max([max(i) for i in dist])
    print(ans)

if __name__ == '__main__':
    resolve()
Buggy python submission (verdict: Runtime Error):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    S = SS()
    K = I()

    ans = ''
    S_k = S[K]
    for i in S:
        if i == S_k:
            ans += i
        else:
            ans += '*'

    print(ans)

if __name__ == '__main__':
    resolve()


Fixed submission:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    S = SS()
    K = I()

    ans = ''
    S_k = S[K-1]
    for i in S:
        if i == S_k:
            ans += i
        else:
            ans += '*'

    print(ans)

if __name__ == '__main__':
    resolve()