qyliang/CodeNanoFix huggingface dataset:
Buggy code:

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

a = s[k-1]

for i in range(n):
    if s[i] != a:
        s[i] = "*"
print("".jpin(s))


Fixed code:

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

a = s[k-1]

for i in range(n):
    if s[i] != a:
        s[i] = "*"
print("".join(s))
Buggy code:


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

moji = S[K]

result = ''
for s in S:
    if s == moji:
        result+=s
    else:
        result+='*'
print(result)

Fixed code:


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

moji = S[K-1]

result = ''
for s in S:
    if s == moji:
        result+=s
    else:
        result+='*'
print(result)
Buggy code:
n = int(input())
s = input()
k = int(input())

moji = s[k]
ans = ''
for i in range(n):
    if s[i] == moji:
        ans = ans + moji
    else:
        ans = ans + '*'
print(ans)

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

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


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

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

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

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

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

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

Fixed code:
input()
s=input()
k=int(input())
for c in s:
	if c!=s[k-1]:
		print("*",end="")
	else:
		print(c,end="")
print("")
Buggy code:
N = int(input())
S = input().rstrip()
K = int(input())

val = list(S)[K-1]
print(N,S,K,list(S),val)
output=[tmp if tmp == val else '*' for tmp in list(S) ]

print("".join(output))

Fixed code:
N = int(input())
S = input().rstrip()
K = int(input())
 
val = list(S)[K-1]
output=[tmp if tmp == val else '*' for tmp in list(S) ]
 
print("".join(output))
Buggy code:
n = int(input())
s = input()
k = int(input())

for i in range(n):
    if s[i]!=s[k]:
        s = s.replace(s[i], '*')
print(s)


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

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

print(ans)

Fixed code:
N = int(input())
S = input()
K = int(input())
char = S[K-1]
ans = ''

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

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

compare_str = S[K - 1]
result_str = ''
for s in list(S):
    if compare_str == s:
	result_str += s
    else:
	result_str += '*'
print(result_str)

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

compare_str = S[K - 1]
result_str = ''
for s in list(S):
  if compare_str == s:
    result_str += s
  else:
    result_str += '*'
print(result_str)
Buggy code:
# coding: utf-8

intLength = int(input())
strSentence = input()
intIndex = int(input())

strAnswer = ""
strWord = strSentence[intIndex-1]
for intIdx in range(intLength):
    print(str(intIndex) + "@" + strSentence[intIdx] + "@" + strWord)

    if strSentence[intIdx] != strWord:
        strAnswer += "*"
    else:
        strAnswer += strSentence[intIdx]

print(strAnswer)


Fixed code:
# coding: utf-8
intLength = int(input())
strSentence = input()
intIndex = int(input())

strAnswer = ""
strWord = strSentence[intIndex-1]

for intIdx in range(intLength):
    if strSentence[intIdx] != strWord:
        strAnswer += "*"
    else:
        strAnswer += strWord

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


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

str = S[K-1]
for i in range(N):
    if(S[i]!=str):
        S[i]="*"
str2 =""
for i in range(N):
    str2=str2+S[i]
print(str2)
Buggy code:
N = int(input())
S = list(input())
K = int(input())
key = S[K-1]
print(key)
for i in range(N):
    if S[i] != key:
        S[i] = "*"
print("".join(S))

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

c = str[k-1]
str2 = ""
for char in str:
  if char == c:
    s += c
  else:
    s += *
    
print(s)

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

c = str[k-1]
str2 = ""
for char in str:
  if char == c:
    str2 += c
  else:
    str2 += "*"
    
print(str2)
Buggy code:
n = int(input())
s = input()
k = int(input())
for a in range(n) :
    if s[a] != s[k] :
        s = s[:a]+"*"+s[a+1:]
print(s)

Fixed code:
n = int(input())
s = input()
k = int(input())
for a in range(n) :
    if s[a] != s[k-1] :
        s = s[:a]+"*"+s[a+1:]
print(s)
Buggy code:
n=int(input())
s=input()
k=int(input())
num = 0
for i in s:
  print(i)
  if i == s[k]:
    num +=1
  else:
    s = s.replace(s[num],'*')
    num +=1

Fixed code:
n=int(input())
s=input()
k=int(input())
num = 0
for i in s:
  if i == s[k-1]:
    num +=1
  else:
    s = s.replace(s[num],'*')
    num +=1
print(s)
Buggy code:
N=input()
S=input()
K=input()
tmp=S[K-1]
out=[]
for i in range(N):
    if S[i]!=tmp:
        out.append("*")
    else:
        out.append(S[i])
ttt=""
for i in out:
    ttt="{}{}".format(ttt,i)
print(ttt)


Fixed code:
N=int(input())
S=input()
K=int(input())
tmp=S[K-1]
out=[]
for i in range(N):
    if S[i]!=tmp:
        out.append("*")
    else:
        out.append(S[i])
ttt=""
for i in out:
    ttt="{}{}".format(ttt,i)
print(ttt)
Buggy code:
N = int(input())
S = str(input())
K = int(input())

swap_word = S[K-1]
print(swap_word)

ans = []
for i in range(N):
  if S[i] != swap_word:
    ans.append("*")
  else:
    ans.append(S[i])

ans_word = ""
for i in range(N):
  ans_word = ans_word + ans[i]

print(ans_word)


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

swap_word = S[K-1]

ans = []
for i in range(N):
  if S[i] != swap_word:
    ans.append("*")
  else:
    ans.append(S[i])

ans_word = ""
for i in range(N):
  ans_word = ans_word + ans[i]

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

Fixed code:
N=int(input())
S=input()
K=int(input())
for s in S:
  print(s if s==S[K-1] else "*",end="")
Buggy code:
input()
S=input()
k=int(input())
for s in S:print(s if s==S[k-1] else "*")
#for s in S:print(s if s==S[k-1] else "*",end="")

Fixed code:
n = input()
S = input()
k = int(input())
for s in S:
  print(s if s == S[k-1] else '*', end='')
Buggy code:
input()
s = list(input())
print("".join(("*" if x != y else x for x in s[int(input())] for y in s )))

Fixed code:
input()
s = list(input())
print("".join(("*" if x != y else x for x in s[int(input())-1] for y in s )))
Buggy code:
import sys
a = []
for l in sys.stdin:
    a.append(l)


word_num = int(a[0])
word = a[1]
char_num = int(a[2])

target_char = word[char_num]

result = []
for each_char in word:
    if each_char == target_char:
        result.append('*')
    else:
        result.append(each_char)
result = ''.join(result)
print(result)


Fixed code:
import sys
a = []
for l in sys.stdin:
    a.append(l)


word_num = int(a[0])
word = a[1].split()[0]
char_num = int(a[2])

target_char = word[char_num - 1]

result = []
for each_char in word:
    if each_char != target_char:
        result.append('*')
    else:
        result.append(each_char)
result = ''.join(result)
print(result)
Buggy code:
N=int(input())
S=input()
K=int(input())
s=S[K]

X=[]*N

for i in S:

    if i==s:
        X.append(i)
    else:
        X.append("*")

Y="".join(X)
print(Y)


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

X=[]*N

for i in S:

    if i==s:
        X.append(i)
    else:
        X.append("*")

Y="".join(X)
print(Y)
Buggy code:
n = int(input())
s = input()
k = int(input())

key = s[k]
result =""
for letter in s:
    if letter == key:
        result = result + key
    else:
        result =result +  "*"

print(result)

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

key = s[k-1]
result =""

for letter in s:
    if letter == key:
        result = result + key
    else:
        result =result +  "*"

print(result)
Buggy code:
N=int(input())
ls_S=list(input())
K=int(input())

for i in range(N-1):
    if ls_S[i]!=ls_S[K]:
        ls_S[i]="*"
for s in ls_S:
    print(s,end = "")
    


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

for i in range(N):
    if ls_S[i]!=ls_S[K-1]:
        ls_S[i]="*"
for s in ls_S:
    print(s,end = "")
Buggy code:
N = int(input())
S = list(input())
K = int(input())
a = S[K-1]
print(a)
for i in range(N):
    if S[i]!=a:
        S[i] = '*'
print(*S,sep='')

Fixed code:
N = int(input())
S = list(input())
K = int(input())
a = S[K-1]
for i in range(N):
    if S[i]!=a:
        S[i] = '*'
print(*S,sep='')
Buggy code:
N = int(input())
S = list(input())
K  = int(input())

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

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

l_replace = [s if S[K-1] in s else '*' for s in S]
print(''.join(l_replace))
Buggy code:
input()
S = input()
K = int(input())

c = S[K]

print("".join([v if v == c else "*" for v in S]))


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

c = S[K-1]

print("".join([v if v == c else "*" for v in S]))
Buggy code:
N = int(input())
S = str(input())
K = int(input())
H = ""
for i in range(N):
  if(SS[i]==SS[K-1]):
    H+=SS[i]
  else:
    H+="*"
print(H)


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

a = S[K + 1]

for i in range(len(S)) :
    if S[i] != a :
        print('*', end="")
    else :
        print(S[i], end="")
print()


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

a = S[K - 1]

for i in range(len(S)) :
    if S[i] != a :
        print('*', end="")
    else :
        print(S[i], end="")
print()
Buggy code:
N = input()
S = input()
K = int(input())

char = S[K]

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

Fixed code:
N = input()
S = input()
K = int(input())
 
char = S[K-1]
 
for s in S:
    print('*',end='') if s != char else print(s,end='')
Buggy code:
N = int(input())
S = input()
K = int(input())

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

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

letter = S[K-1]

ans = ""
for s in S:
    if s != letter:
        ans += "*"
    else:
        ans += s
print(ans)
Buggy code:
N = int(input())
word = input()
word_list=[]
word_num = int(input())

for i in range(len(word)):
    word_list.append(word[i])
    if str(word[i]) == str(word[word_num -1]):
         word_list[i] = '*'

print(" ".join(list(map(str,word_list))))

Fixed code:
N = int(input())
word = input()
word_list=[]
word_num = int(input())

for i in range(len(word)):
    word_list.append(word[i])
    if str(word[i]) != str(word[word_num -1]):
         word_list[i] = '*'

print("".join(list(map(str,word_list))))
Buggy code:
import sys

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

SS = []

for i in range(N):
  if S[i] == S[K]:
    SS.append(S[i])
  else:
    SS.append("*")
    
print(''.join(SS))

Fixed code:
import sys

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

SS = []

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

target = S[K]
S = list(S)

for i in range(N):
   if S[i] == target:
       pass
   else:
       S[i] = "*"
        
S = "".join(S)
print(S)

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

target = S[K-1]
S = list(S)

for i in range(N):
   if S[i] == target:
       pass
   else:
       S[i] = "*"
        
S = "".join(S)
print(S)
Buggy code:
N=int(input())
A=input()
x=int(input())

for i in range(N):
    if A[i]!=A[x-1]:
        print(A[i])
        A=A.replace(A[i],"*")
        
print(A)


Fixed code:
N=int(input())
A=input()
x=int(input())

for i in range(N):
    if A[i]!=A[x-1]:
        A=A.replace(A[i],"*")
        
print(A)
Buggy code:
N = int(input())
S = list(str(input()))
K = int(input())

SK = str(S[K-1])
for i in range(0,N):
    if S[i] == SK:
        pass
    else:
        S[i] = '*'
print(*S)

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

SK = str(S[K-1])
for i in range(0,N):
    if S[i] == SK:
        pass
    else:
        S[i] = '*'
for j in S:
  print(j, end ="")
Buggy code:
n = int(input())
s = str(input())
k = int(input())
ans = ""

for l in s:
  if l != s[k]:
    l = "*"
  ans += l
print(ans)
  

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

for l in s:
  if l != s[k-1]:
    l = "*"
  ans += l
print(ans)
Buggy code:
n = input()
s = int(input())
k = int(input())

char = s[k-1]
ans=''
for i in s:
    if i!=char:
        ans+='*'
    else:
        ans+=char
print(ans)

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

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

t = S[K - 1]

print(t)

ans = ''
for i in S:
    if i == t:
        ans += i
    else:
        ans += '*'

print(ans)

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

t = S[K - 1]

ans = ''
for i in S:
    if i == t:
        ans += i
    else:
        ans += '*'

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

key = S[K]
result = 'a'

for i in range(N):
    if S[i] == key:
        result += S[i]
    elif S[i] != key:
        result += '*'
        

print(result[1:])

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

key = S[K - 1]
result = 'a'

for i in range(N):
    if S[i] == key:
        result += S[i]
    elif S[i] != key:
        result += '*'
        

print(result[1:])
Buggy code:
n=int(input())
s=input()
k=input()

correct = s[k-1]
ans =""
for i in s:
    if i != correct:
        ans += "*"
    else:
        ans+= i

print(ans)


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

correct = s[k-1]
ans =""
for i in s:
    if i != correct:
        ans += "*"
    else:
        ans+= i

print(ans)
Buggy code:
#coding:utf-8

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

base = S[K]
new = []

for i in range(N):
    if S[i] != base:
        new.append('*')
    else:
        new.append(base)

ans = ''.join(new)
print(ans)

Fixed code:
#coding:utf-8

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

base = S[K-1]
new = []

for i in range(N):
    if S[i] != base:
        new.append('*')
    else:
        new.append(base)

ans = ''.join(new)
print(ans)
Buggy code:
a = int(input())
b = input()
c = int(input())
d = b[c]
for i in range(a):
    if b[i]!=d :
        b = b.replace(b[i],'*')
print(b)

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

mozi = s[k-1]
print(mozi)

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

print(*s)


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

mozi = s[k-1]

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

print(*s, sep="")
Buggy code:
n = int(input())
s = str(input())
k = int(input())
wordn = ""
w = s[k-1]
for i in s:
    if w != i:
        word += "*"
    else:
        word += w
print(word)

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

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

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

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

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

print("".join(s))


Fixed code:
n = int(input())
s = [i for i in input()]
k = int(input())
g = s[k-1]

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

print("".join(s))
Buggy code:
N = int(input())
S = input()
K = int(input())
l = S[K - 1]
result = ""
print(l)
for s in S:
    if s != l:
         result += "*"
    else:
         result += s
print(result)

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

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

ans = ""
for i in s:
  if i == s:
    ans += s
  else:
    ans += "*"
print(ans)

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

ans = ""
for i in S:
  if i == s:
    ans += s
  else:
    ans += "*"
print(ans)
Buggy code:
n = int(input())
s = list(map(str,input()))
k = input()

a = s[k-1]

for i in range(n):
    if s[i]==a:
        continue
    else:
        s[i] = "*"

print("".join(s))

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

a = s[k-1]

for i in range(n):
    if s[i]==a:
        continue
    else:
        s[i] = "*"

print("".join(s))
Buggy code:
N = int(input())
S = input()
K = int(input())
str = S[K-1]
for i in range(N):
    if S[i] != str:
        S=S.replace(S[i],'＊')
print(S)


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

Fixed code:
n=int(input())
s=list(input())
k=int(input())
tmp=s[k-1]
for i in range(n):
  print(s[i],end="") if s[i]==tmp else print("*",end="")
print("")
Buggy code:
import sys


def main():
    N = int(sys.stdin.readline())
    S = sys.stdin.readline()
    K = int(sys.stdin.readline())
    s = S[K-1]
    result = ""
    for i in list(S):
        if i == s:
            result = result + i
        else:
            result = result + "*"
    print(result)


if __name__ == "__main__":
    main()


Fixed code:
import sys


def main():
    N = int(sys.stdin.readline())
    S = sys.stdin.readline().strip()
    K = int(sys.stdin.readline())
    s = S[K-1]
    result = ""
    for i in list(S):
        if i == s:
            result = result + i
        else:
            result = result + "*"
    print(result)


if __name__ == "__main__":
    main()
Buggy code:
N = int(input())
S = list(input())
K = int(input())

key = S[K-1]

for i in renge(len(S)):
    if not S[i] == key:
        S[i] = '*'

print(''.join(S))


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

key = S[K-1]

for i in range(len(S)):
    if not S[i] == key:
        S[i] = '*'

print(''.join(S))
Buggy code:
n=int(input())
s=input()
k=int(input())
r=s[k]
ans=""
for i in range(n):
  if s[i]==r:
    ans+=r
  else:
    ans+="*"
print(ans)

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

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

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

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

print(S[K])

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

S = "".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] = '*'

S = "".join(S)

print(S)
Buggy code:
# -*- coding: utf-8 -*-

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

result = ''
sk = S[K-1]
print(sk)
for s in S:
	if sk == s:
		result += s
	else:
		result += '*'

print(result)

Fixed code:
# -*- coding: utf-8 -*-
 
N = int(input())
S = input()
K = int(input())
 
result = ''
sk = S[K-1]

for s in S:
	if sk == s:
		result += s
	else:
		result += '*'
 
print(result)
Buggy 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[i])

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:
#!/usr/bin/python
# coding: UTF-8

import re

len = int(input())
src = input()
t = int(input())
pt = "[^"+src[t]+"]"
print(re.sub(pt,"*",src))

Fixed code:
#!/usr/bin/python
# coding: UTF-8

import re

len = int(input())
src = input()
t = int(input())
pt = "[^"+src[t-1]+"]"
print(re.sub(pt,"*",src))
Buggy code:
n = int(input())
s = input()
k = int(input())

x = s[k]
temp_list = []

for c in s:
  if c is not x:
    temp_list.append('*')
  else:
    temp_list.append(c)

print(''.join(temp_list))

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

x = s[k-1]
temp_list = []

for c in s:
  if c is not x:
    temp_list.append('*')
  else:
    temp_list.append(c)

print(''.join(temp_list))
Buggy code:
# TPBC201B - *e**** ********e* *e****e* ****e**
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:
# TPBC201B - *e**** ********e* *e****e* ****e**
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=str(input())
K=int(input())
Target=S[K]
Ans=""
for i in range(0,len(S),1):
  if S[i]==S[K]:
    Ans+=str(S[i])
  elif S[i]!=S[K]:
    Ans+="*"

print(Ans)


Fixed code:
N=input()
S=str(input())
K=int(input())
Ans=""
for i in range(0,len(S),1):
  if S[i]==S[K-1]:
    Ans+=str(S[i])
  elif S[i]!=S[K-1]:
    Ans+="*"

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

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

print(ans)

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