qyliang/CodeNanoFix huggingface dataset:
Buggy code:
# -*- coding: utf-8 -*-
n = int(input())
s = str(input())
k = int(input())
"""
n = 7
s = "djfsfok"
k = 3
"""
index_num = [n for n, v in enumerate(s) if v == s[k-1]]
ans = list("*"*n)
index_num = list(index_num)
for i in range(0, len(index_num)):
    print(index_num[i])
    ans[index_num[i]] = s[k-1]
print("".join(ans))

Fixed code:
# -*- coding: utf-8 -*-
n = int(input())
s = str(input())
k = int(input())
"""
n = 7
s = "djfsfok"
k = 3
"""
index_num = [n for n, v in enumerate(s) if v == s[k-1]]
ans = list("*"*n)
index_num = list(index_num)
for i in range(0, len(index_num)):
    ans[index_num[i]] = s[k-1]
print("".join(ans))
Buggy code:
N = int(input())
S = list(input())
K = int(input())

for i in range(N):
  if S[i] != S[K]:
    S[i] = "*"
    
print(*S, sep="")



Fixed code:
N = int(input())
S = list(input())
K = int(input())

for i in range(N):
  if S[i] != S[K-1]:
    S[i] = "*"
    
print(*S, sep="")
Buggy code:
n = int(input())
list =list(input())
m = ""
j = int(input())
for i in range(n):
  if list[i] == list[j]:
    m += list[j]
  else:
    m += "*"
print(m)

Fixed code:
n = int(input())
list =list(input())
m = ""
j = int(input()) - 1
for i in range(n):
  if list[i] == list[j]:
    m += list[j]
  else:
    m += "*"
print(m)
Buggy code:
n=int(input())
s=input()
x=s[int(input())]
for i in range(n):
  if s[i]==x:
    print(x,end="")
  else:
    print("*",end="")

Fixed code:
n=int(input())
s=input()
x=s[int(input())-1]
for i in range(n):
  if s[i]==x:
    print(x,end="")
  else:
    print("*",end="")
Buggy code:
N = int(input())
S = input()
K = int(input())
M = str()
for i in range(N):
    if S[i] != S[K]:
        M= M +"*"
    else:
        M= M +S[i]
print(M)

Fixed code:
N = int(input())
S = input()
K = int(input())
M = str()
for i in range(N):
    if S[i] != S[K-1]:
        M= M +"*"
    else:
        M= M +S[i]
print(M)
Buggy code:
n=int(input())
s=list(input())
k=int(input())
p=s[k]
for i in range(n):
    if s[i]!=p:
        s[i]='*'
print(''.join(s))

Fixed code:
n=int(input())
s=list(input())
k=int(input())
p=s[k-1]

for i in range(n):
    if s[i]!=p:
        s[i]='*'
print(''.join(s))
Buggy code:
input()
s = input()
k = int(input())
print(''.join(c if c == s[k] else '*' for c in s))

Fixed code:
input()
s = input()
k = int(input())
print(''.join(c if c == s[k-1] else '*' for c in s))
Buggy code:
n=int(input())
s=list(input())
k=int(input())
for i in range(n):
    if s[i]!=s[k]:
        s[i]='*'
print(print(' '.join(s)))

Fixed code:
n = int(input())
s = list(input())
k = int(input()) -1
for i in range(n):
    if s[i] != s[k]:
        s[i] = "*"
print("".join(s))
Buggy code:
N=input()
s=input()
K=int(input())

t=s[K-1]
for i in range(N):
    if s[i]!=t:
        S[i]="*"
print("".join(s))


Fixed code:
N=int(input())
s=list(input())
K=int(input())
t=s[K-1]
for i in range(N):
    if s[i]!=t:
        s[i]="*"
print("".join(s))
Buggy code:
N = int(input())
S = [str(x) for x in input().split()]
K = int(input())
for a in range(N):
    if not S[a] == S[K - 1]:
        S[a] = '*'
print(''.join(S))

Fixed code:
N = int(input())
S = [str(x) for x in input()]
K = int(input())
for a in range(N):
    if not S[a] == S[K - 1]:
        S[a] = '*'
print(''.join(S))
Buggy code:
N = int(input())
str = str(input())
K = int(input())
str_list = list(str)
for i in range(N):
    if str_list[i] != str_list[int(K)]:
        str_list[i] = '*'
str_changed = ''.join(str_list)
print(str_changed)

Fixed code:
N = int(input())
str = list(input())
K = int(input()) - 1
str_list = list(str)
for i in range(N):
    if str[i] != str[K]:
        str[i] = '*'
str_changed = ''.join(str)
print(str_changed)
Buggy code:
N=int(input())
S=str(input())
n=int(input())
d=S[n]
a=""
for i in S:
    if i!=d:
        a+="*"
    elif i==d:
        a+=i
print(a)

Fixed code:
N=int(input())
S=str(input())
n=int(input())
d=S[n-1]
a=""
for i in S:
    if i!=d:
        a+="*"
    elif i==d:
        a+=i
print(a)
Buggy code:
N = int(input())
S = input()
K = int(input())

t = S[K]
newS = [s if s == t else '*' for s in S]
print(''.join(newS))

Fixed code:
N = int(input())
S = input()
K = int(input())

t = S[K-1]
newS = [s if s == t else '*' for s in S]
print(''.join(newS))
Buggy code:
n = int(input())
s = input()
s = list(s)
k = int(input())
word = s[k]
for i in range(n):
    if s[i] != word:
        s[i] = "*"
print("".join(s))

Fixed code:
n = int(input())
s = input()
s = list(s)
k = int(input())
word = s[k-1]
for i in range(n):
    if s[i] != word:
        s[i] = "*"
print("".join(s))
Buggy code:
import numpy as np
n=3
a=[input() for i in range(n)]
print(a)
S=list(a[1])
s=len(S)
K=int(a[2])-1

for i in range(s):
  if S[i]!=S[K]:
    S[i]="*"
mojiretu = ''
    
for x in S:
    mojiretu += x
    
print(mojiretu)

Fixed code:
import numpy as np
n=3
a=[input() for i in range(n)]

S=list(a[1])
s=len(S)
K=int(a[2])-1

for i in range(s):
  if S[i]!=S[K]:
    S[i]="*"
mojiretu = ''
    
for x in S:
    mojiretu += x
    
print(mojiretu)
Buggy code:
n=int(input())
s=input()
k=int(input())
S=list(s)
for i in range(n):
    if S[i]!=S[k-1]:
        S[i]='*'
ans=','.join(S)
print(ans)

Fixed code:
n=int(input())
s=input()
k=int(input())
S=list(s)
for i in range(n):
    if S[i]!=S[k-1]:
        S[i]='*'
ans=''.join(S)
print(ans)
Buggy code:
k = int( input())
s = list(str(input()))
n = int( input())
  
for i in range(len(s)):
	if s[i] != s[n-1]:
	s[i] = "*"
          
print(s)


Fixed code:
k = int( input())
s = list(str(input()))
n = int( input())
a = ""
  
for i in range(len(s)):
    if s[i] != s[n-1]:
        s[i] = "*"
    a+=(str(s[i]))
        
print(a)
Buggy code:
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 code:
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()
Buggy code:
n=input()
m=input()
l=int(input())
kotae=""
key=m[l-1]

for i in range(len(m)):
    if m[i] != key:
        kotae=kotae+"*"
    else:
        kotae=kotae+key
        

Fixed code:
n=input()
m=input()
l=int(input())
kotae=""
key=m[l-1]

for i in range(len(m)):
    if m[i] != key:
        kotae=kotae+"*"
    else:
        kotae=kotae+key
print(kotae)
Buggy code:
N = int(input())
S = input()
K = int(input())

s = S[K]

answer = ''
for i in range(N):
    if S[i] != s:
        answer += '*'
    else:
        answer += s
print(answer)

Fixed code:
N = int(input())
S = input()
K = int(input())

s = S[K-1]

answer = ''
for i in range(N):
    if S[i] != s:
        answer += '*'
    else:
        answer += s
print(answer)
Buggy code:
n = int(input())
sstr = input()
k = int(input())


s = list(sstr)

for i in range(n):
 if s[k-1] != s[i]:
  s[i] = "*"


sStr = "".join(s)

Fixed code:
n = int(input())
sstr = input()
k = int(input())


s = list(sstr)

for i in range(n):
 if s[k-1] != s[i]:
  s[i] = "*"


sStr = "".join(s)
print(sStr)
Buggy code:
N = int(input())
S = str(input())
K = int(input())
S_str = S[K-1]
i = 0
for i in range(N-1):
    if S_str != S[i]:
        S = S.replace(S[i], "*")
        i += 1
    else:
        i += 1
print(S)


Fixed code:
N = int(input())
S = str(input())
K = int(input())
S_str = S[K-1]
i = 0
for i in range(N):
    if S_str != S[i]:
        S = S.replace(S[i], "*")
        i += 1
    else:
        i += 1
print(S)
Buggy code:
n = int(input())
s = input()
k = int(input())

res = ""
for i in s:
    if i!=s[k]:
        res += "*" 
    else:
        res += s[k]
else:
    print(res)


Fixed code:
n = int(input())
s = input()
k = int(input())-1

res = ""
for i in s:
    if i!=s[k]:
        res += "*" 
    else:
        res += s[k]
else:
    print(res)
Buggy code:
n = int(input())
s = input()
k = int(input())
t = n[k-1]
for i in s:
    if i!=t:
        s.replace(i,"*")
print(s)

Fixed code:
n = int(input())
s = input()
k = int(input())
t = s[k-1]
for i in s:
    if i!=t:
        s = s.replace(i,"*")
print(s)
Buggy code:
import sys

input = sys.stdin.readline


def main():
    n = input()
    s = input()
    k = int(input())
    print("".join([c if c == s[k - 1] else "*" for c in s]))


if __name__ == "__main__":
    main()


Fixed code:
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    s = input().rstrip()
    k = int(input())
    print("".join([c if c == s[k - 1] else "*" for c in s]))


if __name__ == "__main__":
    main()
Buggy code:
n=int(input())
s=input()
k=int(input())
a=''
b=s[k-1]
for i in s:
  if i==b:a+=i
  else:a+=*
print(a)

Fixed code:
n=int(input())
s=input()
k=int(input())
a=''
b=s[k-1]
for i in s:
  if i==b:a+=i
  else:a+='*'
print(a)
Buggy code:
N = int(input())
S = input()
K = input()

moji = S[K-1]

for s in S:
  if moji == s:
    print(moji, end='')
  else:
    print('*', end='')
print()

Fixed code:
N = int(input())
S = input()
K = int(input())

booked = S[K-1]
for s in S:
    print(s if s == booked else '*', end='')
Buggy code:
N = int(input())
S = input()
K = input()
 
moji = S[K-1]
ns = ''
for s in S:
  if moji == s:
    ns += moji
  else:
    ns += '*'
print(ns)

Fixed code:
N = int(input())
S = input()
K = int(input())
 
moji = S[K-1]
ns = ''
for s in S:
  if moji == s:
    ns += moji
  else:
    ns += '*'
print(ns)
Buggy code:
n = int(input())
s = list(input())
k = int(input())
t = s[k]
for i in range(n):
    if s[i] != t:
        s[i] = "*"
print(*s,sep="")

Fixed code:
n = int(input())
s = list(input())
k = int(input())
t = s[k-1]
for i in range(n):
    if s[i] != t:
        s[i] = "*"
print(*s,sep="")
Buggy code:
n = int(input())
s = input()
k = int(input())
c = s[k]
ans = ''
for i in range(n):
    if s[i] == c:
        ans += c
    else:
        ans += '*'
print(ans)

Fixed code:
n = int(input())
s = input()
k = int(input())
c = s[k-1]
ans = ''
for i in range(n):
    if s[i] == c:
        ans += c
    else:
        ans += '*'
print(ans)
Buggy code:
N = int(input())
S = list(input())
K = int(input())
for i in range(N):
  if S[i] != S[K]:
    S[i] = "*"
print("".join(S))

Fixed code:
N = int(input())
S = list(input())
K = int(input())
for i in range(N):
  if S[i] != S[K-1]:
    S[i] = "*"
print("".join(S))
Buggy code:
N = input()
S = input()
K = input()
alphabet = S[int(K)-1]
answer = ''
print(alphabet)
for n in range(int(N)):
    if S[n] == alphabet:
        answer = answer+S[n]
    else:
        answer = answer+'*'
print(answer)


Fixed code:
N = input()
S = input()
K = input()


alphabet = S[int(K)-1]
answer = ''
for n in range(int(N)):
    if S[n] == alphabet:
        answer = answer+S[n]
    else:
        answer = answer+'*'

print(answer)
Buggy code:
n = int(input())
s = input()
k = int(input())

keep_word = s[k-1]
for ss in s:
    if ss == keep_word:
        print(ss)
    else:
        print('*')

Fixed code:
n = int(input())
s = input()
k = int(input())

keep_word = s[k-1]
for ss in s:
    if ss == keep_word:
        print(ss, end='')
    else:
        print('*', end='')
Buggy code:
input()
S = input()
k = int(input())
for s in S:
  print(s if s==S[k-1] else "*")

Fixed code:
input()
S = input()
k = int(input())
for s in S:
  print(s if s==S[k-1] else "*",end="")
Buggy code:
n = int(input())
a = input()
l = int(input())
for i in range(n):
  if a[l-1] != a[i]:
    print('*', sep='')
  else:
    print(a[l-1], sep='')


Fixed code:
n = int(input())
a = input()
l = int(input())
for i in range(n):
  if a[l-1] != a[i]:
    print('*', end='')
  else:
    print(a[l-1], end='')
Buggy code:
def solve(n, s, k):
    return "".join([("*" if s[i] != s[k] else s[i]) for i in range(n)])

n = int(input())
s = input()
k = int(input())
print(solve(n, s, k))

Fixed code:
def solve(n, s, k):
    return "".join([("*" if s[i] != s[k-1] else s[i]) for i in range(n)])

n = int(input())
s = input()
k = int(input())
print(solve(n, s, k))
Buggy code:
N = int(input())
S = input()
K = int(input())
ans = ''
for i in S:
  if i = S[K-1]:
    ans += S[i]
  else:
    ans += '*'
print(ans)

Fixed code:
N = int(input())
S = input()
K = int(input())
ans = ''

for i in range(N):
  if S[K-1] != S[i]:
    ans += '*'
  else:
    ans += S[i]
  
print(ans)
Buggy code:
N = int(input())
S = list(input())
K = int(input())

for i in range(len(S)):
  if S[i] != S[K]:
    S[i] = '*'
print(''.join(S))

Fixed code:
N = int(input())
S = list(input())
K = int(input()) - 1

for i in range(len(S)):
  if S[i] != S[K]:
    S[i] = '*'
print(''.join(S))
Buggy code:
N = int(input())
S = input()
K = int(input())

for i in range(N):
  if S[K-1] != S[i]:
    S[i] == '*'
  
print(S)

Fixed code:
N=int(input())
S=input()
K=int(input())
re=S[K-1]
for i in range(N):
    if(S[i]!=re):
        S=S[:i]+'*'+S[i+1:]
print(S)
Buggy code:
n = int(input())
s = input()
k = int(input())
w = s[k]
ss = ""
for i in range(n):
    if(s[i] == w):
        ss += w
    else:
        ss += "*"
print(ss)

Fixed code:
n = int(input())
s = input()
k = int(input())
w = s[k-1]
ss = ""
for i in range(n):
    if(s[i] == w):
        ss += w
    else:
        ss += "*"
print(ss)
Buggy code:
N = input()
S = input()
K = input()

char = S[int(K)-1]

#print(char)

ans = []

for j in range(len(S)):
  #print(S[j])
  if char != S[j]:
    ans.append("*")
    #print("!=")   
  else:
    ans.append(char)
    continue

print(" ".join(ans))



Fixed code:
N = input()
S = input()
K = input()

char = S[int(K)-1]

#print(char)

ans = []

for j in range(len(S)):
  #print(S[j])
  if char != S[j]:
    ans.append("*")
    #print("!=")   
  else:
    ans.append(char)
    continue

print("".join(ans))
Buggy code:
N = int(input())
S = input()
K = int(input())
ans = ""

for i in range(N):
    if(S[K] != S[i]):
        ans += "*"
    else:
        ans += S[K]
print(ans)

Fixed code:
N = int(input())
S = input()
K = int(input())
ans = ""

for i in range(N):
    if(S[K-1] != S[i]):
        ans += "*"
    else:
        ans += S[K-1]
print(ans)
Buggy code:
N = int(input())
S = input()
K = int(input())

kc = S[K]
ans = ''
for c in S:
  if c != kc:
    ans += '*'
  else:
    ans += c

print(ans)

Fixed code:
N = int(input())
S = input()
K = int(input())

kc = S[K - 1]
ans = ''
for c in S:
  if c != kc:
    ans += '*'
  else:
    ans += c

print(ans)
Buggy code:
n = int(input())
s = input()
k = int(input())

c = s[k]
a = ""
for t in list(s):
 if t == c:
  a += c
 else:
  a += "*"
print(a) 

Fixed code:
n = int(input())
s = input()
k = int(input())

c = s[k-1]
a = ""
for t in list(s):
 if t == c:
  a += c
 else:
  a += "*"
print(a)
Buggy code:
n=int(input())
s=input()
k=int(input())
j=s[k-1]
new_s=""
for i in range(n):
  if s[i]!=j:
    new_s+="*"
  else:
    new_s+=j

Fixed code:
n=int(input())
s=input()
k=int(input())
j=s[k-1]
new_s=""
for i in range(n):
  if s[i]!=j:
    new_s+="*"
  else:
    new_s+=j
print(new_s)
Buggy code:
n = int(input())
s = input()
k = int(input())

letter = s[k-1]
out = ''

for i in range(n):
    print(s[i], letter)
    if s[i] == letter:
        out += s[i]
    else:
        out += '*'

print(out)

Fixed code:
n = int(input())
s = input()
k = int(input())

letter = s[k-1]
out = ''

for i in range(n):
    if s[i] == letter:
        out += s[i]
    else:
        out += '*'

print(out)
Buggy code:
N = int(input())
S = input()
K = int(input())

tmp = str(S[K-1])
l = []
for n,i in enumerate(S):
    print(i,tmp)
    if i==tmp:
        l.append(i)
    else:
        l.append('*')
print("".join(l))

Fixed code:
N = int(input())
S = input()
K = int(input())

tmp = str(S[K-1])
l = []
for n,i in enumerate(S):
    if i==tmp:
        l.append(i)
    else:
        l.append('*')
print("".join(l))
Buggy code:
N = int(input())
S = input()
K = int(input())
for i in range(N):
    if(S[K] == S[i]):
        print(S[K],end="")
    else:
        print("*",end="")
print()    

Fixed code:
N = int(input())
S = input()
K = int(input())
for i in range(N):
    if(S[K-1] == S[i]):
        print(S[i],end="")
    else:
        print("*",end="")
print()
Buggy code:
A =int(input())
B=input()
c=int(input())
d=B[c]
E=""
for i in range(A):
    if B[i]==d:
        E=E+d
    else:
        E=E+"*"
print(E)

Fixed code:
A =int(input())
B=input()
c=int(input())
d=B[c-1]
E=""
for i in range(A):
    if B[i]==d:
        E=E+d
    else:
        E=E+"*"
print(E)
Buggy code:
N = int(input())
S = list(input())
K = int(input())

target = S[K]
ans = ""
for s in S:
    ans += s if s == target else "*"
print(ans)


Fixed code:
N = int(input())
S = list(input())
K = int(input())

target = S[K-1]
ans = ""
for s in S:
    ans += s if s == target else "*"
print(ans)
Buggy code:
N = int(input())
S = input()
K = int(input())

S_list = list(S)

moji = S_list[K-1]

for i in range(len(S_list)):
    if S_list[i]!=moji:
        S_list[i]="*"
print(S_list)

Fixed code:
N = int(input())
S = input()
K = int(input())

S_list = list(S)

moji = S_list[K-1]

for i in range(len(S_list)):
    if S_list[i]!=moji:
        S_list[i]="*"
print("".join(S_list))
Buggy code:
N=int(input())
S=input()
K=int(input())
Slist =list(S)
for i in range(N):
	if Slist[K] == Slist[i]:
		continue
	else:
		Slist[i]="*"
S = ''.join(Slist)
print(S)

Fixed code:
N=int(input())
S=input()
K=int(input())
Slist =list(S)
for i in range(N):
	if Slist[K-1] == Slist[i]:
		continue
	else:
		Slist[i]="*"
S = ''.join(Slist)
print(S)
Buggy code:
N=int(input())
S=list(input())
K=int(input())
for i in range(N):
    if S[i]!=S[K-1]:
        S[i]='*'
''.join(S)
print(S)

Fixed code:
N=int(input())
S=list(input())
K=int(input())
for i in range(N):
    if S[i]!=S[K-1]:
        S[i]='*'
print(''.join(S))
Buggy code:
in_data = [input() for i in range(3)] 
 
n = int(in_data[0])
s = in_data[1]
k = int(in_data[2])




target_c = s[k]
new_s = ''
for c in s:
    if c == target_c:
        new_s += c
    else:
        new_s += '*'
 
print(new_s)

Fixed code:
in_data = [input() for i in range(3)] 
 
n = int(in_data[0])
s = in_data[1]
k = int(in_data[2])





target_c = s[k - 1]
new_s = ''
for c in s:
    if c == target_c:
        new_s += c
    else:
        new_s += '*'
 
print(new_s)
Buggy code:

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
s = list(input())
k = ii()
for i in s:
    if i != s[k-1]:
        i = '*'
print(''.join(s))

Fixed code:

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

n = ii()
s = list(input())
k = ii()
for i in range(len(s)):
    if s[i] != s[k-1]:
        s[i] = '*'
print(''.join(s))
Buggy code:
N = int(input())
S = str(input())
K = int(input())
#N = 5
#S = "error"
S = list(S)
#K = 2
char = S[K]
for i in range(len(S)):
    if S[i] != char:
        S[i] = "*"
print(''.join(S))

Fixed code:
N = int(input())
S = str(input())
K = int(input())
#N = 5
#S = "error"
S = list(S)
#K = 2
char = S[K-1]
for i in range(len(S)):
    if S[i] != char:
        S[i] = "*"
print(''.join(S))
Buggy code:
N=int(input())
S=list(input())
K=int(input())
moji=S[K-1]
for i in range(N):
  if S[i]!=moji:
    S[i]="*"
mojiretu=""
for x in S:
  mojiretu+=moji
print(mojiretu)
  

Fixed code:
N=int(input())
S=list(input())
K=int(input())
moji=S[K-1]
#print(moji)

for i in range(N):
    
    if S[i]!=moji:
        S[i]="*"
mojiretu=""
for x in S:
  mojiretu+=x
print(mojiretu)
Buggy code:
n = int(input())
s = input()
k = int(input())

c = s[n - 1]
ans = ''
for ci in s:
    if ci == c:
        ans += c
    else:
        ans += "*"

print(ans)


Fixed code:
n = int(input())
s = input()
k = int(input())

c = s[k - 1]
ans = ''
for ci in s:
    if ci == c:
        ans += c
    else:
        ans += "*"

print(ans)
Buggy code:
n = int(input())
s = input()
k = int(input())

str_list = list(s)
x = str_list[k-1]
print(n,s,k,x)
for i in range(len(s)):
    if str_list[i] != x:
        str_list[i] = "*"
str_changed = "".join(str_list)
print(str_changed)

Fixed code:
n = int(input())
s = input()
k = int(input())

str_list = list(s)
x = str_list[k-1]
for i in range(len(s)):
    if str_list[i] != x:
        str_list[i] = "*"
str_changed = "".join(str_list)
print(str_changed)
Buggy code:
N = int(input())
S = list(int(input()))
K = int(input())
s = S[K-1]

for i in range(N):
    if S[i] == s:
        pass
    else:
        S[i] = '*'

print(''.join(S))



Fixed code:
N = int(input())
S = list(input())
K = int(input())
s = S[K-1]

for i in range(N):
    if S[i] == s:
        pass
    else:
        S[i] = '*'

print(''.join(S))
Buggy code:
n=int(input())
s=input()
k=int(input())
t=s[k]
c=''
for i in range(0,n):
    if s[i] != t:
        c += '*'
    else: c += s[i]

print(c)

Fixed code:
n=int(input())
s=input()
k=int(input())
t=s[k-1]
c=''
for i in range(0,n):
    if s[i] != t:
        c += '*'
    else: c += s[i]

print(c)
Buggy code:
n=int(input())
s=input()
k=s[int(input())]
a=""
for i in range(n):
    a+=["*",k][int(s[i]==k)]
print(a)

Fixed code:
n=int(input())
s=input()
k=s[int(input())-1]
a=""
for i in range(n):
    a+=["*",k][int(s[i]==k)]
print(a)
Buggy code:
from sys import stdin
N = int(stdin.readline().rstrip())
S = list(input())
K = int(stdin.readline().rstrip())
for s in S:
    if s != S[K-1]:
        print('*')
    else: print(s)


Fixed code:
from sys import stdin
N = int(stdin.readline().rstrip())
S = list(input())
K = int(stdin.readline().rstrip())
for s in S:
    if s != S[K-1]:
        print('*', end="")
    else: print(s, end="")
Buggy code:
N = int(input())
S = input()
K = int(input())

cha = S[K-1]
list_ = [s for s in S]
print(len(list_))
for i in range(N):
  if cha != S[i]:
    list_[i] = "*"
print("".join(list_))

Fixed code:
N = int(input())
S = input()
K = int(input())
 
cha = S[K-1]
list_ = [s for s in S]
for i in range(N):
  if cha != S[i]:
    list_[i] = "*"
print("".join(list_))
Buggy code:

n = int(input())
s = str(input())
k = int(input())

a = []
for i in s:
    
    if i != s[k]:
        a.append('*')
    else:
        a.append(i)

print(*[i for i in a],sep='')

Fixed code:
n = int(input())
s = str(input())
k = int(input())

a = []
for i in s:
    
    if i != s[k-1]:
        a.append('*')
    else:
        a.append(i)

print(*[i for i in a],sep='')
Buggy code:
import re

N = int(input())
S = str(input())
K = int(input())

print(re.sub(r'[^%s]'%S[K], '*', S))

Fixed code:
import re

N = int(input())
S = str(input())
K = int(input())

print(re.sub(r'[^%s]'%S[K-1], '*', S))
Buggy code:
N = int(input())
S = str(input())
K = int(input())
K_S = S[K - 1]
print(K_S)
for i in range(N):
    if S[i] != K_S:
        S = S.replace(S[i], '*')
print (S)

Fixed code:
N = int(input())
S = str(input())
K = int(input())
K_S = S[K - 1]
for i in range(N):
    if S[i] != K_S:
        S = S.replace(S[i], '*')
print (S)
Buggy code:
N = int(input())
S = input()
K = int(input())
e = S[K-1]
ans = []
for i in range(N):
  if S[i] != 'e':
    ans.append("*")
  else:
    ans.append(S[i])
print(''.join(ans))

Fixed code:
N = int(input())
S = input()
K = int(input())
e = S[K-1]
ans = []
for i in range(N):
  if S[i] != e:
    ans.append("*")
  else:
    ans.append(S[i])
print(''.join(ans))