Problem:


Score : 200 points

Problem Statement

You are given a string S of length N consisting of lowercase English letters, and an integer K.
Print the string obtained by replacing every character in S that differs from the K-th character of S, with *.

Constraints

1 \leq K \leq N\leq 10

S is a string of length N consisting of lowercase English letters.

N and K are integers.

Input

Input is given from Standard Input in the following format:

N
S
K

Output

Print the string obtained by replacing every character in S that differs from the K-th character of S, with *.

Sample Input 1

5
error
2

Sample Output 1

*rr*r

The second character of S is r. When we replace every character in error that differs from r with *, we get the string *rr*r.

Sample Input 2

6
eleven
5

Sample Output 2

e*e*e*

Sample Input 3

9
education
7

Sample Output 3

******i**



Sample input:
5
error
2


Sample output:
*rr*r

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution code:
n=int(input())
string=input()
i=int(input())
newString=""
for char in string:
    if char!=string[i-1]:
        newString+="*"
    else:
        newString+=char
print(newString)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
list = []
Sk = S[K-1]
for i in range(0,N):
  s = S[i]
  s_ans = Sk if s == Sk else "*"
  list.append(s_ans)
ans = "".join(list)
print(ans)

Submission status: Accepted

Solution 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("\n")

Submission status: Accepted

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

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

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
a = s[k - 1]
for j in range(n):
  if s[j] == a:
    None
  else:
      s = s.replace(s[j],"*")
print(s)

Submission status: Accepted

Solution code:
N,S,K = [input() for i in range(3)]
a = list(S)
b = a[int(K) - 1]
for i in range(int(N)):
    if a[i] != b:
        a[i] = "*"
for i in range(int(N)):
    print(a[i],end="")

Submission status: Accepted

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

s =list(s)

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

print(''.join(s))

Submission status: Accepted

Solution 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))

Submission status: Accepted

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

c = S[K-1]
ans = ''
for s in S:
    if c != s:
        ans += '*'
    else:
        ans += s
print(ans)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline
n = int(input())
s = input()[:-1]
k = int(input())
c = s[k-1]
ans = ''
for i in s:
    if i == c:
        ans += c
    else:
        ans += '*'
print(ans)

Submission status: Accepted

Solution 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))

Submission status: Accepted

Solution code:
def eee(s,k):
    a = s[k-1]
    k = list(filter(lambda x:x!=a,s))
    z = ''.join(s)
    for i in k:
        z = z.replace(i,'*')
    return z

n = int(input())
s = list(input())
k = int(input())
print(eee(s,k))

Submission status: Accepted

Solution code:
import re
def main():
    N = int(input())
    S = input()
    K = int(input())
    nontarget = S[K - 1]
    S = S.replace(nontarget, '0')
    S = re.sub('\D', '*', S)
    S = S.replace('0', nontarget)
    print(S)
main()

Submission status: Accepted

Solution code:
import sys

N = input()
S = input()
K = input()
result = ''
c = S[int(K)-1]
for target in S:
    if target == c:
        result += c
    else:
        result += '*'
print(result)

Submission status: Accepted

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

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

print(''.join(S))

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())
k = int(input())
 
char = s[k-1]
result = ""
for x in s:
    if x == char:
        result += char
    else:
        result += "*"
print(result)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
for c in s:
  if c!=s[k-1]:
    print("*",end="")
  else:
    print(c,end="")

Submission status: Accepted

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

word = S[K-1]
chars = list(S)

rep = lambda c: "*" if c != word else c

newchars = [rep(c) for c in chars]
print("".join(newchars))

Submission status: Accepted

Solution code:
N = input()
S = input()
K = input()
k = S[int(K) - 1:int(K)]
for s in S:
    if s != k:
        S = S.replace(s, '*')
print(S)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())
S = input()
K = int(input())
ans = [s if s == S[K-1] else '*' for s in S]

print(''.join(ans))

Submission status: Accepted

Solution code:
import re
N = int(input())
str = input()
num = int(input())

for i in range(N):
    if str[i] == str[num-1]:
        print(str[i], end="")  # 改行なしで出力

    else:
        print("*", end="")

Submission status: Accepted

Solution code:
N=int(input())
S=input()
l=len(S)
S=list(S)
K=int(input())#Kと異なる文字

B=[]
for i in range(N):
    if S[K-1]!=S[i]:
        B.append("*")
    elif S[K-1]==S[i]:
        B.append(S[i])

c="".join(B)
print(c)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
save = S[K-1]
ans = "*"*N
for x in range(N):
    if x == 0 :
        if S[x] == save:
            ans =save + ans[x+1:]
        continue
    if S[x] == save:
        ans = ans[:x] + save + ans[x+1:]
print(ans)

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution code:
wordSize = int(input())
word= str(input())
removePosition = int(input())
reword=''
for i in range(wordSize):
    if(word[i]!=word[removePosition-1]):
        reword +=(str("*"))
    else:
        reword+=(word[i])
print(reword)

Submission status: Accepted

Solution 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="")

Submission status: Accepted

Solution 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="")

Submission status: Accepted

Solution code:
import re

N = int(input())
S = input()
K = int(input())
test = list(S)
str = ""
for i in test:
    if(i == test[K - 1]):
        str += i
    else:
        str += "*"
print(str)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
w = S[K-1]
tmp = []
for s in S:
    if s == w:
        tmp.append(s)
    else:
        tmp.append('*')

print(''.join(tmp))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
s = input()
k = int(input())

selected = s[k - 1]
print(''.join(['*' if l != selected else l for l in s ]))

Submission status: Accepted

Solution 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))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
word = S[K-1]
for i in range(N):
    if S[i] == word:
        a = 1
    else:
        S = S.replace(S[i],"*")
#print(word)
print(S)

Submission status: Accepted

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

a = S[K-1]
b = []
for i in S:
	if(i == a):
		b.append(i)	
	else:
		b.append('*')
t = ''.join(b)
print(t)

Submission status: Accepted

Solution code:
import sys

def parse(inp):
    n=int(next(inp))
    s=list(next(inp))[:-1]
    k=int(next(inp))    
    return n,s,k
  
def main(inp):
    n,s,k=inp
    
    keep=s[k-1]
    
    ans=""
    for i in range(n):
        if(s[i]==keep): ans+=s[i]
        else: ans+="*"
            
    print(ans)
    
main(parse(sys.stdin))

Submission status: Accepted

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

sk = s[k-1]
ans = []
for ss in s:
  if ss == sk:
    ans.append(ss)
  else:
    ans.append("*")
a = ''.join(ans)
print(a)

Submission status: Accepted

Solution 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))

Submission status: Accepted

Solution code:
word_size = int(input())
word = input()
num =  int(input())

replace_word = word[num-1]

for i in word:
    if i != replace_word:
        print("*",end="")
    else:
        print(i,end="")

Submission status: Accepted

Solution 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)

Submission status: Accepted

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

target = S[K-1]
result = ""
for i in S:
    if target == i:
        result += i
    else:
        result += '*'

print(result)

Submission status: Accepted

Solution code:
N=int(input())
S=str(input())
K=int(input())
target = S[K-1]
arr = ''
 
for i in range(N):
	if S[i]==target:
		arr+=target
	else:
		arr+=('*')
 
print(arr)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
out = []
for i in range(n):
    if s[i] == s[k-1]:
        out.append(s[k-1])
    else:
        out.append('*')
print(''.join(out))

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution code:
import numpy as np
  
input()
S = np.asarray(list(str(input())))
K = int(input())
s = S[K-1]
S[S!=s] = "*"
print("".join(S))

Submission status: Accepted

Solution code:
REPLACE_CHAR = "*"

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

keep_char = s[k - 1]
replaced_str = ""

for char in s:
    if char != keep_char:
        replaced_str += REPLACE_CHAR
    else:
        replaced_str += char

print(replaced_str)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
 
a = ""
 
for i in range(n):
  if s[i] == s[k-1]:
    a = a + s[k-1]
  else:
    a = a + "*" 
print(a)

Submission status: Accepted

Solution code:
N = int(input())
Str = input()
K = int(input())
List = list(Str)

chikan = List[K-1]

for i in range(N):
    if List[i] != chikan:
        List[i] = '*'

Str = "".join(List)
print(Str)

Submission status: Accepted

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

moji=s[k-1]

line=[]

for i in range(n):
    line.append(s[i])

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

output=""

for i in range(len(line)):
    output=output+line[i]

print(output)

Submission status: Accepted

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

x = S[K-1]

for i in range(len(S)):
    if S[i] != x:
        S = S.replace(S[i],'*')
print(S)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
target = S[K-1]
result = []
result2 = ''
for i in S:
    if i is target:
        result.append(i)
    else:
        result.append('*')
for i in result:
    result2 += i

print(result2)

Submission status: Accepted

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

s=list(S)

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

s_a=''.join(s)

print(s_a)

Submission status: Accepted

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

k = S[K-1]

ans = []

for i in S:
    if i == k:
        ans.append(k)
    else:
        ans.append('*')

print(''.join(ans))

Submission status: Accepted

Solution 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))

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution code:
import sys

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

L = []
for i in range(N):
    if S[i] != S[K-1]:
        L.append("*")
    else:
        L.append(S[i])

ans = ''
for i in range(N):
    ans += L[i]

print(ans)

Submission status: Accepted

Solution code:
_  = input()
s = input()
index = int(input())-1

result = ''

t = s[index]

for i in s:
  if i != t:
    result += '*'
  else:
    result += i
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution 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 = "")

Submission status: Accepted

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

oki = S[K-1]
ans = ""
for i in range(N):
    if S[i] == oki:
        ans += S[i]
    else:
        ans += "*"

print(ans)

Submission status: Accepted

Solution code:
a=int(input())
b=input()
c=int(input())
b=list(b)
l=b[c-1]
r=[i for i, x in enumerate(b) if x==l]
s=['*']*a
for k in r:
    s[k]=b[k]
print(''.join(s))

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution 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))

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
K = int(input())
 
for i in S:
    if S[K-1] == i:
        print(i, end="")
    else:
        print("*", end="")
print()

Submission status: Accepted

Solution code:
def replace_ast(N, S, K):
    rstr = S[K-1]
    outstr = ''
    for s in S:
        if s == rstr:
            outstr += s
        else:
            outstr += '*'
    print(outstr)


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

replace_ast(N, S, K)

Submission status: Accepted

Solution code:
num = int(input())
text = input()
a = int(input())
w = text[a-1]
result = ""

for i in range(num):
    if text[i] == w:
        result += text[i]
    else:
        result += '*'
print(result)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


from sys import stdin



############################################


# read data for n sequences.
n = stdin.readline()
N = int(n)
n = stdin.readline()
S = str(n)
n = stdin.readline()
K = int(n)
#data = [int(stdin.readline().rstrip()) for _ in range(n)]
key = S[K-1]

out=[]
for i,l in enumerate(S):
	if i < N:
		
		if l != key:
			out.append("*")
		elif l =="\n":
			x=1
		else:
			out.append(l)
out1=''
for o in out:
	out1+=o
print(out1)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = list(input())
    K = int(input())
    spec_s = S[K-1]
    ans = ""
    for i in range(len(S)):
        if S[i] != spec_s:
            S[i] = '*'
    for x in S:
        ans += x
    print(ans)
main()

Submission status: Accepted

Solution code:
n = int(input())
s = input()
t = [i for i in s]
k = int(input())
moji = " "
for j in range(len(t)):
  if t[j] != t[k-1]:
    t[j]="*"

for k in t:
  moji+=k
print(moji)

Submission status: Accepted

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

check = S[K-1]

A = []

for i in range(N):
    if check != S[i]:
        A.append("*")
    else:
        A.append(check)
print("".join(A))

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
k=int(input())
d=s[k-1]
s_list=list(s)
for a in range(n):
  if s[a] != d:
    s_list[a]="*"
s2="".join(s_list)
print(s2)

Submission status: Accepted

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

chk = s[k-1]
for i in range(len(s)):
	if(s[i] != chk):
		s[i] = "*"
	print(s[i],end="")
print("")

Submission status: Accepted

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

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

S_changed = "".join(S_list)
print(S_changed)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

target=S[K-1]
ans=""

for i in range(N):
    if S[i]==target:
        ans+=target
    else:
        ans+='*'        
print(ans)

Submission status: Accepted

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

sk = s[k-1]
anslis = [s[i] for i in range(n)]
ans = ""

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

for i in range(n):
    ans = ans + str(anslis[i])

print(ans)

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
list_s = list(s)

a = s[k - 1]

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

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
K = int(input())
for k in range(N):
    if not S[k] == S[K - 1]:
        S[k] = '*'
newS = ''.join(S)
print(newS)

Submission status: Accepted

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

replace = S[K - 1]
list_str = list(S)

for i, data in enumerate(S):
    if data != replace:
        list_str[i] = '*'

S = "".join(list_str)

print(S)

Submission status: Accepted

Solution code:
N=int(input())
s=str(input())
K=int(input())
S=[]

for i in s:
    S.append(i)
k=S[K-1]
S=["*" if S[i]!=k else S[i] for i in range(N)]
print("".join(map(str,S)))

Submission status: Accepted

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

res = ""

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

Submission status: Accepted

Solution code:
N=int(input())
S=input()

S=list(S)

K=int(input())

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

S=''.join(S)

print(S)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import os

x,y,z = [input() for i in range(3)]
x = int(x)
z = int(z)

moji = y[z-1]

y = list(y)

for i in range(x):
    if y[i] != moji:
        y[i] = '*'

print("".join(y))

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution 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))

Submission status: Accepted

Solution code:
import re

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

char = S[K-1]
temp = S.replace(S[K-1], '|')
temp2 = re.sub(r"\w", "*", temp)
print(temp2.replace('|', char))

Submission status: Accepted

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

x = S[K-1]
s = [i for i, t in enumerate(S) if t == x]

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

A = "".join(S)
print(A)

Submission status: Accepted

Solution code:
N = int(raw_input())
S = raw_input()
K = int(raw_input())

s = S[K-1]

print "".join(map(lambda x: x if x==s else "*", list(S)))

Submission status: Accepted

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

targ=S[K-1]
ans = ""

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


print(ans)

Submission status: Accepted

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

num = ord (S [K - 1])

for i in range (N):
    if ord (S [i]) == num:
        print (S [i], end = '')
    else:
        print ('*', end = '')

Submission status: Accepted

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

S_list = list(S)

for i in range(N):
    if S_list[i] != S_list[K-1]:
        S_list[i] ="*"
    else:
        continue

S_new = ""
for i in S_list:
    S_new += i

print(S_new)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your# coding: utf-8
# Your code here!
N = int(input())
S = str(input())
K = int(input())
#rint(N,S,K)
 
WRITE = list(S)
CHARA = S[K-1]
#print(CHARA)
 
for i in range(N):
    if S[i] != CHARA:
        S = S[:i] + '*' + S[i+1:]
 
print(S)

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution code:
N, S, K = [input() for i in range(3)]
ans = 0
S = list(S)
for n in range(int(N)):
    if S[n] != S[int(K)-1]:
        S[n] = '*'
ans = ''.join(S)
print(ans)

Submission status: Accepted

Solution code:
length = int(input())
string = input()
K_str_id = int(input())

K_str = string[K_str_id - 1]

output = ""
for tmp_str in string:
    if tmp_str == K_str:
        output += tmp_str
    else:
        output += "*"
print(output)

Submission status: Accepted

Solution code:
N = int(input())
S = list(map(str,input()))
K = int(input())
text = S[K-1]

correct_list = []
for i in S:
   if i != text:
       correct_list.append("*")
   else:
       correct_list.append(i)
print(''.join(correct_list))

Submission status: Accepted

Solution code:
import re
input()
S=raw_input()
K=input()
a=[]
for i in range(len(S)):
  k=map(lambda x:x.start(),re.finditer(S[K-1],S))
  if i in k:
      a.append(S[i])
  else:
      a.append("*")
print(''.join(a))

Submission status: Accepted

Solution 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))

Submission status: Accepted

Solution code:
a = int(input())
mozi = input()
b = int(input())

test = mozi[b-1]

ans = ""

for i in mozi:
    if i != test:
        ans+="*"
    else:
        ans+=i

print(ans)

Submission status: Accepted

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

a = ""
for s in S:
  if s != S[K-1]:
    a += "*"
  else:
    a += s
print(a)

Submission status: Accepted

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

k -= 1

target = s[k]

ret = list(s)
for i, item in enumerate(s):
    if item != target:
        ret[i] = "*"
print(''.join(ret))

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N = int(input())
S = list(input())
K = int(input())
a = S[K-1]
ans = []
for k in S:
    if k != a:
        ans.append("*")
    else:
        ans.append(k)

answer = "".join(ans)
print(answer)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
k=int(input())
a=s[k-1]
t=[]
for i in range(n):
    if(s[i] == a):
        t.append(s[i])
    else:
        t.append('*')
        continue
for j in range(n):
    print(t[j],end='')
print()

Submission status: Accepted

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

# print(list(s))
t = str()
for i in range(n):
    if s[i] == s[k-1]:
        pass
    else:
        s[i] = '*'
    t += s[i]

print(t)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
k=int(input())
c=""
for i in range(n):
  if s[i]==s[k-1]:
    c+=s[i]
  else:
    c+="*"
print(c)

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution code:
import sys

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

word = s[k-1]
for i in s:
    if i != word:
        sys.stdout.write('*')
    else:
        sys.stdout.write(i)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
S = input()
K = int(input())

target = S[K - 1]

x = []
for char in S:
    if char != target:
        x.append('*')
    else:
        x.append(char)

print(''.join(x))

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
T = ''

for s in S:
    if s != S[K-1]:
        s = '*'
    T += s
print(T)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
target = s[k-1]
for i, obj in enumerate(s):
    if obj is not target:
        s = s.replace(obj, "*")
print(s)

Submission status: Accepted

Solution 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))

Submission status: Accepted

Solution 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)

Submission status: Accepted

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

exa = s[k-1]
for i in s:
    if i != exa:
        s = s.replace(i,'*')
    
print(s)

Submission status: Accepted

Solution code:
N = int(input())
s = input()
ans= ' '
k = int(input())
const = s[k-1]
for x in s:
	if x == const:
		ans += x
	else:
		ans += '*'
print(ans)

Submission status: Accepted

Solution code:
len=input()
str=input()
index=input()
safe=str[int(index) - 1]
result = ""
for i in range(int(len)):
    add=safe
    if str[i] != safe:
        add="*"

    result += add

print(result)

Submission status: Accepted

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

hogo = list(S)
rewrite = list(S)

cnt = 0
for s in range(0, N):
    if rewrite[s] != (hogo[K - 1]):
        rewrite[cnt] = "*"
    cnt += 1

print(''.join(rewrite))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
print(''.join([x if s[k-1] == x else '*' for x in s]))

Submission status: Accepted

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

a=s[k-1]
t=""

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

print(t)

Submission status: Accepted

Solution 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))

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())
K = int(input())
for n in range(N):
    if S[n] != S[K-1]:
        S = S[:n] + '*' + S[n+1:]
print(S)

Submission status: Accepted

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

key = s[k-1]
new_s = ''
for st in s:
    if st != key:
        new_s = new_s + '*'
    else:
        new_s = new_s + key

print(new_s)

Submission status: Accepted

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

change_s = S[K-1]
change_after = ""
for n in range(N):
    if S[n] !=change_s:
        change_after += '*'
    else:
        change_after += S[n]
print(change_after)

Submission status: Accepted

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

moji=S[K-1]
S_ok=""
for i in range(N):
    now_moji=S[i]
    if now_moji==moji:
        S_ok=S_ok+now_moji
    else:
        S_ok=S_ok+"*"

print(S_ok)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
t = list(s)
u = ""
for i in range(n):
    if t[i]!=t[k-1]:
        t[i]="*"
for j in range(n):
    u = u+t[j]
print(u)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
s = S[K - 1]
output = ""
for ss in S:
    if ss == s:
        output += s
    else:
        output += "*"

print(output)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

n = int(input())
s = input()
k = int(input())
temp = []

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

ans = "".join(temp)

print(ans)

Submission status: Accepted

Solution code:
N = int(raw_input())
S = list(raw_input())
K = int(raw_input())

hoge = S[K-1]

for i in range(N):

      if S[i] != hoge:
            S[i] = "*"

print("".join(S))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
	n = int(input())
	s = input()
	k = int(input())
	tmp=''
	for i in range(n):
		if i == k-1:
			tmp = s[i]	
	ans = ''
	for c in s:
		if c != tmp:
			ans+='*'
		else:
			ans+=c
	print(ans)

if __name__ == '__main__':
	import sys
	sys.exit(main())

Submission status: Accepted

Solution code:
import sys


N = raw_input().strip()
S = raw_input().strip()
K = int(raw_input().strip())
A = []
ans = ''
for s in S:
    if s!=S[K-1]:
        A += '*'
    else:
        A += s
        
for x in A:
    ans += x
print(ans)

Submission status: Accepted

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

sk = S[K-1]
out = ''

for s in S:
    if s != sk:
        out += '*'
    else:
        out += sk
print(out)

Submission status: Accepted

Solution code:
N=int(input())
S=input()
s=[]
for i in S:
    s.append(i)
K=int(input())
letter=s[K-1]
ans=''
for i in s:
    if i==letter:
        ans+=i
    else:
        ans+='*'
print(ans)

Submission status: Accepted

Solution 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()

Submission status: Accepted

Solution 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)

Submission status: Accepted

Solution 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], end="")

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
K = int(input())
for i in range(N):
    if S[i] != S[K-1]:
        S[i] = "*"
S_edit = "".join(S)
print(S_edit)