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**

Solution (Python):
N = int(input())
S = input()
K = int(input())
S = list(S)
e = S[K-1]
for i in range(N):
    if S[i] == e:
        continue
    S[i] = '*'
print(''.join(S))

Solution (Python):
from sys import exit

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

s = S[K - 1]

ans = ''

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

print(ans)

Solution (Python):
n = int(input())
s = input()
k = int(input())
a = s[k-1]
s = list(s)
for i in range(len(s)):
        if s[i] != a:
                s[i] = "*"

for i in range(len(s)):
        print(s[i], end='')

Solution (Python):
N = int(input())

S = input()

K = int(input())

ans = []
target = str(S[K-1])

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

ans = ''.join(ans)

print(ans)

Solution (Python):
N = int(input())
S = input()
K = int(input())
T = ['']*N
letter = S[K-1]
for i in range(N):
  if S[i] == letter:
    T[i] = S[i]
  else:
    T[i] = "*"
print(''.join(T))

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

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

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

s = S[K-1]

txt = ''

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

print(txt)

Solution (Python):
n=int(input())
s=input()
k=int(input())
m=s[k-1]
news=''
for i in s:
    if i==m:
        news=news+m
    else:
        news=news+'*'
print(news)

Solution (Python):
if __name__ == '__main__':
    n = int(input())
    s = input()
    k = int(input())

    chars = []
    needle = s[k - 1]

    for i in range(len(s)):
        if s[i] != needle:
            chars.append('*')
        else:
            chars.append(s[i])

    print(''.join(chars))

Solution (Python):
N  = int (input())
S = input()
K = int(input())
K = K-1
ans = ""
c = S[K]

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

Solution (Python):
a=int(input())
s=list(input())	
r=int(input())

txt = s[r-1]
for i in range(len(s)):
    if(s[i] != txt):
        s[i] = "*"
s = ''.join(s)
print(s)

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

tar = S[K - 1]

res = []
for s in S:
    if s != tar:
        res.append('*')
    else:
        res.append(tar)

print(''.join(res))

Solution (Python):
n = input()
str = input()
v = int(input()) - 1

ans = ""

for i in str:
	if i == str[v]:
		ans += i
	else:
		ans += "*"

print(ans)

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


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

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

check = S[K-1]


ans = ''
for s in S:
    if s != check:
        ans += '*'
    else:
        ans += s
print(ans)

Solution (Python):
n=int(input())
s=input()
k=int(input())
a=s[k-1]
b=[]
for i in s:
    if a!=i:
        b.append(i)
for i in b:
    s=s.replace(i,"*")
print(s)

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

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

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

Solution (Python):
N = int(input())
S = [c for c in input()]
K = int(input())

x = S[K - 1]
result = [c if c == x else '*' for c in S]
print(''.join(result))

Solution (Python):
def main():
	N = int(input())
	S = input()
	K = int(input())
	non_change = S[K-1]
	ans = ""
	for c in S:
		if c != non_change:
			ans += "*"
		else:
			ans += c
	print(ans)

if __name__ == '__main__':
	main()

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

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

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

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

Solution (Python):
n = int(input())
slis = list(input())
k = int(input())
let = slis[k-1]
for i in range(n):
  if slis[i] != let:
    slis[i] = "*"
print("".join(slis))

Solution (Python):
N = int(input())
S = input()
K = int(input())
ans = ''
tmp = S[K-1]
for i in range(N):
  if S[i] == tmp:
    ans+=tmp
  else:
    ans+='*'
print(ans)

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

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

s_k = S[K-1]

s = ''
for i in range(len(S)):
    if S[i] != s_k:
        s += '*'
    else:
        s += S[i]

print(s)

Solution (Python):


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

Sarray = list(S)
a = Sarray[K - 1]
Sprc = ''

for i in range(len(Sarray)):
    if Sarray[i] != a:
        Sarray[i] = '*'
    Sprc += Sarray[i]

print(Sprc)

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

x = s[k-1]

ans=""
for c in s:
    if c != x:
        ans += "*"
    else:
        ans += c

print(ans)

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

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

Solution (Python):





import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline() for _ in range(n)]
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main(N, S, K):
    S = list(S)
    s = S[K-1]
    for i in range(N):
        if S[i] != s:
            S[i] = '*'
    S = ''.join(S)
    print(S)

N = i2n()
S = i2s()
K = i2n()
main(N, S, K)

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

Solution (Python):


















import math
import copy
from collections import defaultdict
from collections import Counter
from collections import deque

from itertools import product

from itertools import permutations

from itertools import combinations
from bisect import bisect_left, bisect_right



dy = [0, 0, 1, -1]
dx = [1, -1, 0, 0]
INF = float("inf")

def i_inpl(): return int(input())
def s_inpl(): return map(int,input().split())
def l_inpl(): return list(map(int, input().split()))

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

ssi = S[K-1]

ans = ""

for si in S:
    if si != ssi:
        ans = ans + "*"
    else:
        ans = ans + si

print(ans)

Solution (Python):
N = int(input())
S = [i for i in input()]
K = int(input())

swap = S[K-1]

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

print(''.join(S))

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

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

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

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

ch = S[K-1]
ans = ''
for v in S:
    if v == ch:
        ans += v
    else:
        ans += '*'
print(ans)

Solution (Python):
n = int(input())
s = input()
k = int(input())
ans = []
j = s[k-1]
for i in s:
  if i !=j:
    ans.append('*')
  else:
    ans.append(i)
print(''.join(ans))

Solution (Python):
N = int(input())
s = input()
K = int(input())

tmp = s[K-1]

res = ""
for i in range(N):
    if s[i] != tmp:
        res += '*'
    else:
        res += s[i]
        
print(res)

Solution (Python):
n = int(input())
s = input()
k = int(input())
kstr = s[k-1]
res = ""
for i in range(len(s)):
    if s[i] != kstr:
        res += "*"
    else:
        res += kstr

print(res)

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

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

Solution (Python):
n = int(input())
s = input()
c = s[int(input()) - 1]

print("".join([ i if i == c else '*' for i in s]))

Solution (Python):
_n=int(input())
_s=input()
_k=int(input())
ans="".join(["*" if s!=_s[_k-1] else s for s in _s])
print(ans)

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

for c in list(s):
    if c == s[k-1]:
        print(c, end="")
    else:
        print("*", end="")
print("")

Solution (Python):
n=int(input())
s=list(str(input()))
k=int(input())

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

Solution (Python):
N = int(input())
S = list(str(input()))
K = int(input())

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

Solution (Python):
n=int(input())
s=list(input())
k=int(input())
x=s[k-1]
for i in range(len(s)):
    if s[i]!=x:
        s[i]="*"

s="".join(s)
print(s)

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

Solution (Python):
N = int(input())
S = input()
K = int(input())
letter = S[K-1]
print(''.join(s if s==letter else "*" for s in S ))

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

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

Solution (Python):



N = int(input())
S = [x for x in input()]
K = int(input()) - 1

for i, s in enumerate(S):
    if S[K] != s:
        S[i] = '*'
        
print(''.join(S))

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

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

Solution (Python):
N = int(input())
S = list(input())
K = int(input())
for i,s in enumerate(S):
    if s!=S[K-1]:
        S[i]='*'
print(''.join(S))

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

sk = S[K-1]

print("".join([s if s == sk else "*" for s in S]))

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    INF = float("inf")
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    N = int(input().rstrip())
    S = list(_ for _ in input())
    K = int(input().rstrip())
    c = S[K-1]
    for i in range(N):
        if(S[i]!=c):
            S[i] = '*'
        
    print(''.join(S))
    
if __name__ == '__main__':
    main()

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


slist = []
for ss in s:
    if ss == s[k-1]:
        slist.append(ss)
    else:
        slist.append('*')

import sys
for ss in slist:
    sys.stdout.write(ss)
print()

Solution (Python):
N = int(input())
S = input()
K = int(input())
s = ''
for i in S:
    if(i!=S[K-1]):
        s+='*'
    else:
        s+=i
print(s)

Solution (Python):
n = int(input())
s = input()
k = int(input())
sk = s[k-1]
ls = []
for i in s:
    ls.append(i)
for i in range(n):
    if ls[i] != sk:ls[i] = '*'
print(''.join(ls))

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

diff = set(S) - set(S[K - 1])

for d in diff:
	S = S.replace(d, "*")
print(S)

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

Solution (Python):
def ans():

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

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

ans()

Solution (Python):
N=int(input())
S=input()
K=int(input())
ans=''
for moji in S:
    if moji!=S[K-1]:
        ans+='*'
    else:
        ans+=moji
print(ans)

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

target_c = S[K-1]

out_str = ""
for c in S:
    if c != target_c:
        out_str += "*"
    else:
        out_str += c

print(out_str)

Solution (Python):


def main():
    N = int(input())
    S = input()
    K = int(input())

    char = S[K-1]

    for c in S:
        print(c if c == char else "*", sep='', end='')
    print('')


if __name__ == '__main__':
    main()

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

c=S[K-1]

ans=[]

for s in S:
    if s==c:
        ans.append(c)
    else:
        ans.append('*')
    
print(''.join(ans))

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

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

Solution (Python):
import math



n=int(input())
s=input()
k=int(input())
s2=""
ch=s[k-1]
for a in range(len(s)):
    if ch==s[a]:
        s2+=s[a]
    else:
        s2+="*"
print(s2)

Solution (Python):
n=int(input())
s=input()
k=int(input())
a=s[k-1]
ans=''
for x in s:
  if x!=a:
    ans+='*'
  else:
    ans+=x
print(ans)

Solution (Python):
def main():
    N = int(input())
    S = input()
    K = int(input())
    t = S[K-1]
    result = ""
    for s in S:
        if s == t:
            result += s
        else:
            result += "*"
    print(result)

if __name__ == '__main__':
    main()

Solution (Python):
import re
N = int(input())
S = input()
K = int(input())

S = "".join([i if i == S[K-1] else "*" for i in S])
print(S)

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

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

Solution (Python):
n = int(input())
s = input()
k = int(input())
a = s[k-1]
print("".join([a if s_ == a else "*" for s_ in s]))

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

s = S[K - 1]

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

Solution (Python):
N=int(input())
S=input()
K=int(input())
c=S[K-1]
ans=list('*'*N)
for i in range(N):
    if S[i]==c:
        ans[i]=c
print(''.join(ans))

Solution (Python):
n = int(input())  
str = list(input())  
k = int(input())
k -= 1
ans = ""

for i in range(n):
    if str[i] != str[k]:
        ans += "*"
    else:
        ans += str[i]

print(ans)

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

ans = ""
note = S[K-1]
for s in S:
    if s == note:
        ans += note
    else:
        ans += "*"

print(ans)

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

c = s[k-1]

ans = ''
for m in s:
    if m != c:
        ans += '*'
    else:
        ans += c
print(ans)

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

e = s[k - 1]

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

print("".join(s))

Solution (Python):
n = int(input())
s = list(input())
a = int(input())
inde = s[a-1]

ans = ""

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

Solution (Python):
N=input()
S=input()
K=int(input())
target=S[K-1]
o=""
for s in S:
    if s==target:
        o+=s
    else:
        o+="*"
print(o)

Solution (Python):
n = int(input())
s = list(input())
k = int(input())
ans = ''
m = s[k-1]
for ss in s:
  if ss == m:
    ans += ss
  else:
    ans += '*'
print(ans)

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

Solution (Python):
def solve():
  n = int(input())
  s = input()
  k = int(input())
  ans = ""
  place = s[k-1]
  
  for i in s:
    if i != place:
      ans += '*'
    else:
      ans += place
  print(ans)
solve()

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N=INT()
S=input()
K=INT()

s=S[K-1]
T=''
for i in range(N):
    if S[i]==s:
        T+=s
    else:
        T+='*'
print(T)

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

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

print('.'.join(S).replace('.',''))

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

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

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

let = s[k-1]

ans = ""
for i in range(n):
    x = s[i]
    if x == let:
        ans+=x
    else:
        ans += "*"
print(ans)

Solution (Python):
n=int(input())
S=input()
k=int(input())
char=S[k-1]
out=""
for i in S:
    if i!=char:
        out+="*"
    else:
        out+=i
print(out)

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

Solution (Python):
import re

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

print(re.sub("[^" + S[K-1] + "]", '*', S))

Solution (Python):
n=int(input())
s=input()
k=s[int(input())-1]
p=[]
for i in s:
    if i!=k:p.append("*")
    else:p.append(k)
print("".join(p))

Solution (Python):

def kari():
    N = list(map(int, input().split()))
    A, B = map(int, input().split())

def main():
    N = int(input())
    S = list(input())
    K = int(input())

    aaa = S[K - 1]

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



if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
S = input()
K = int(input())
T = S[K-1]
ans = ''
for i in range(N):
  if S[i] == T:
    ans += T
  else:
    ans += '*'
print(ans)

Solution (Python):
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g

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

key = s[k-1]
ans = ""
for i in range(n):
    if s[i] == key:
        ans += s[i]
    else:
        ans += "*"

print(ans)

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

target = s[k - 1]
s_new = ''
for i in range(n):
    if s[i] != target:
        s_new += '*'
    else:
        s_new += s[i]
print(s_new)

Solution (Python):
N = int(input())
S = input()
K = int(input())-1

target = S[K]
for i in S:
    if i != target:
        print('*', end='')
    else:
        print(i, end='')

Solution (Python):
n = int(input())
s = input()
k = int(input())
tmp = s[k-1]
res = ""
for i in s:
    if i == tmp:
        res += i
    else:
        res += "*"
print(res)

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

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

c = S[K - 1]

result = "".join(x if x == c else "*" for x in S )

print(result)

Solution (Python):

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

Solution (Python):
_ = int(input())
S = input()
K = int(input())

sc = S[K - 1]
ret = ''
for c in S:
    if c == sc:
        ret += c
    else:
        ret += '*'
print(ret)

Solution (Python):
import math
from operator import itemgetter
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
s = S()
K = I()

tmp = s[K-1]

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

print(ans)

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

Solution (Python):


import itertools
from collections import Counter
import bisect

def main():
    N = int(input())
    S = input()
    K = int(input())
    K -= 1
    target = S[K]
    ans = ''
    for s in S:
        ans += '*' if s != target else s
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

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

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

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

target = S[K-1]

res = ''
for s in S:
    if s != target:
        res += '*'
    else:
        res += s
print(res)

Solution (Python):
n=int(input())
S=input()
k=int(input())
i=S[k-1]
for s in S:print(s if s==i else "*",end="")

Solution (Python):
n=int(input())
s=list(input())
k=int(input())
c=s[k-1]
for i in range(n):
    if s[i]!=c:
        s[i]="*"
print("".join(s))

Solution (Python):
N = int(input())
S = input()
K = int(input())
res = ''

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

print(res)

Solution (Python):
def main():
    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))
    return 0

main()

Solution (Python):
n = int(input())
s = input()
k = int(input())
a = s[k-1]
ans = ''
for b in s:
    if b == a:
        ans += b
    else:
        ans += '*'
print(ans)

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

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

Solution (Python):

import sys
INF = float("inf")


def solve(N: int, S: str, K: int):
    kth = S[K-1]
    s = list(S)
    for i in range(N):
        if s[i] != kth:
            s[i] = "*"
    print("".join(s))
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    S = next(tokens)  
    K = int(next(tokens))  
    solve(N, S, K)


if __name__ == '__main__':
    main()

Solution (Python):


def solve():
    N = int(input())
    S = input()
    K = int(input())

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

    for moji in S:
        if moji == t:
            ans += moji
        else:
            ans += "*"
    print(ans)

if __name__ == "__main__":
    solve()

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    S = str(input().strip())
    K = int(input())

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

    return ans


if __name__ == '__main__':
    print(main())

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

Solution (Python):
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
import collections
from operator import itemgetter

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)
n = ip()                                     


a = input()                                  

k = ip()                      




k-=1
b = []
for i in range(n):
    if a[i] == a[k]:
        b.append(a[k])
    else: b.append('*')
print(''.join(b))

Solution (Python):
from sys import stdin
N = int(input())
S = input()
K = int(input())
ans= ""
for e in S:
    if e == S[K-1]:
        ans += e
    else:
        ans += "*"
print(ans)

Solution (Python):
n=int(input())
s=list(input())
k=int(input())
p=s[k-1]
for i in range(len(s)):
  if s[i]!=p:
    s[i]="*"
print("".join(s))

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

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

p=S[K-1]
ans=""
for i in S:
    if i==p:
        ans+=i
    else:
        ans+="*"
        
print(ans)

Solution (Python):
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n = ni()
s = list(ns())
k = ni()
a = s[k - 1]
for i in range(len(s)):
    if s[i] != a:
        s[i] = '*'
print(''.join(s))

Solution (Python):

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

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

Solution (Python):
N = int(input())
S = input()
K = int(input())
t = S[K-1]
ans = ''
for s in S:
    ans += '*' if s!=t else s

print(ans)

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

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

target = S[K - 1]

res = ""
for s in S:
    if s != target:
        res += "*"
    else:
        res += target
print(res)

Solution (Python):

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

Solution (Python):
n = int(input())
listS= list(input())
k=int(input())

index=0
while index < len(listS):
    if listS[index]!=listS[k-1]:
        listS[index]="*"
    index+=1

print("".join(listS))

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

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

print(ans)

Solution (Python):

import sys
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    '''
    H is number of rows
    '''
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read() for _ in range(H)]


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols

    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])

    return ret


N = read_a_int()
S = input()
K = read_a_int()

target = S[K-1]

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

print(*ans, sep="")

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

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

Solution (Python):
n = int(input())
s = list(input())
k = int(input())
si = s[k-1]
for i in range(n):
    if s[i] != si:
        s[i] = '*'
str_s = ''
for i in range(n):
  str_s += s[i]
print(str_s)

Solution (Python):
N = int(input())
S = input()
K = int(input())
s = S[K-1]

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

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

target = S[K-1]

a = ''
for c in S:
    if c != target:
        a += '*'
    else:
        a += c
print(a)

Solution (Python):



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

a=[int(i) in range(n)]
a=[0]*n
for i in range(n):
    a.append(int(i))
'''

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

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

ans = ""

ch = s[k-1]

for c in s:
    if c == ch:
        ans+=ch
    else:
        ans+="*"

print(ans)

Solution (Python):
n=int(input())
s=input()
k=int(input())
check=s[k-1]
ans=''
for i in range(n):
  if s[i]==check:
    ans+=s[i]
  else:
    ans+='*'
print(ans)

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

Solution (Python):
n=int(input())
s=input()
k=int(input())
t=s[k-1]
l=[]
for i in s:
    if i==t:
        l.append(i)
    else:
        l.append("*")
print("".join(l))

Solution (Python):
import sys















input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())



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

print(''.join(S))

Solution (Python):
N = int(input())
S = input()
K = int(input())
ans = ''
k = S[K-1]
for i in S:
    if i != k:
        ans += '*'
    else:
        ans += i
print(ans)

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

s = S[K - 1]

ans = ''

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

print(ans)

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

k = S[K-1]

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

print(ans)

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