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=input()
s=input()
sl=list(s)
k=int(input())

res=[]
c = sl[k-1]
for i in sl:
	if c==i:
		res.append(i)
	else:
		res.append("*")
        
print("".join(res))

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 += s[k-1]
    else:
        ans += '*'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 20 21:06:53 2019

@author: doppe
"""

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

rep = s[k-1]
ans =''

for _s in s:
    if not _s == rep:
        ans = ans + '*'
    else:
        ans = ans + _s

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#A, B, C = map(int,input().split())


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



tmp = S[K-1]

ans = []
for i in S:
    if (i == tmp) :
        ans.append(tmp)
    else:
        ans.append("*")

print("".join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

buff = S[K-1]
for i in range(len(S)):
    if buff != S[i]:
        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.replace(S[i],'*')
print(S)

Submission status: Accepted

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

target = S[K - 1]
converted = []
for c in S:
    if c != target:
        c = "*"
    converted.append(c)
print("".join(converted))

Submission status: Accepted

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

letter = S[K-1]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

word = S[K-1:K]
S_new = ""

for i in range(N):
    if S[i:i+1] == word:
        S_new += word
    else:
        S_new += "*"
        
print(S_new)

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
k = int(input())
t = s[k-1]
for i in range(0,n) :
    if s[i] != t :
        s[i] = '*'
s = ''.join(s)
print(s)

Submission status: Accepted

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

k = S[K-1]
l = [''] * N

for i, s in enumerate(S):
    if s == k:
        l[i] = s
    else:
        l[i] = "*"
print("".join(l))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
nons = input()
a = input()
b = list(a)
c= int(input())
d = b[c-1]
result = str()
for i in range(0,len(b)):
    if b[i] == d:
        pass
    else:
        b[i] = '*'
for i in range(len(b)):
    result = result+b[i]
print(result)

Submission status: Accepted

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

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

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+=S[i]
    else:
        ans+='*'

print(ans)

Submission status: Accepted

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

c = s[int(k) - 1]

result = ''
for i in range(int(n)):
    if s[i] != c:
        result += '*'
    else:
        result += s[i]
print(result)

Submission status: Accepted

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

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

print(S)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(S)):
    if(S[i] != S[K-1]):
        S = S.replace(S[i], '*')

print(S)

Submission status: Accepted

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

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

Submission status: Accepted

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

r_list = []
k = S[K-1]
for s in S:
  if s == k:
    r_list.append(s)
  else:
    r_list.append("*")
r_seq = "".join(r_list)
print(r_seq)

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 = input()
K = int(input())
change_word = S[K-1]
S_list = list(S)
for i, word in enumerate(S_list):
    if word != change_word:
        S_list[i] = '*'
print(''.join(S_list))

Submission status: Accepted

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

Submission status: Accepted

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

lsts=list(s)
a=k-1
chara=lsts[a]

ss=copy.copy(s)
lstss=list(ss)

for i in range(n):
    if lstss[i]!=chara:
        lsts[i]="*"

ans=""
for i in range(n):
    ans+=lsts[i]

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import re

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

err = s[k-1]
s = re.sub("[^"+err+"]", "*", s)

print(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.replace(s[i],"*")
    else:
        pass
print(s)

Submission status: Accepted

Solution code:
n = int(input())
s = str(input())
k = int(input())
x = s[k-1]
s_list = list(s)
str_changed = ''
for i in range(len(s)):
    if s_list[i] != x:
        s_list[i] = '*'
str_changed = "".join(s_list)
print(str_changed)

Submission status: Accepted

Solution code:

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

ans = ''

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
K = int(input())
Selected = S[K-1]
for i,k in enumerate(S):
    if k != Selected:
        S[i] = "*"
strs = "".join(S)
print(strs)

Submission status: Accepted

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

Submission status: Accepted

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


target_str = S[K-1]

out = ''
for s in S:
  if s != target_str:
    tmp = '*'
  else:
    tmp = s

  out += tmp

print(out)

Submission status: Accepted

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

t = S[K-1]

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

Submission status: Accepted

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

# input

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


m = [i for i in S]
mm = S[K-1]

moji = ""
for n in S:
    if n==mm:
        moji += n
    else:
        moji+="*"


print(moji)

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.replace(s[i], '*')
    
print(s)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b, c = LI()
    if b < a:
        a,b = b,a
    if a <= c <= b:
        print("Yes")
    else:
        print("No")
    return

#B
def B():
    n = II()
    s = input()
    a = list(set(list(s)))
    k = II()-1
    for i in a:
        if s[k] != i:
            s = s.replace(i, "*")
    print(s)
    return

#C
def C():
    n = II()
    s = S()
    s.append(0)
    ans = 0
    for k in range(n):
        if s[k] == 0:
            break
        if s[k] == "#" and s[k + 1] == ".":
            ans += 1
    print(ans)
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

list_s = list(s)

target_chr = list_s[k - 1]

result = ""

for i in list_s:
    if i != target_chr:
        result += "*"
    else:
        result += i


print(result)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

s = S[K-1]

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
target = S[K-1]

for s in S:
  if s not in [target]:
    print('*', end='')
  else:
    print(s, end='')

Submission status: Accepted

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

moji = s[k-1]
ans = ""
for i in range(len(s)):
    if s[i] != moji:
        ans += str("*")
    else:
        ans += str(s[i])
    
print(ans)

Submission status: Accepted

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

target = S[K - 1]

for i in range(N):
    if S[i] != target:
        S[i] = "*"

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = list(input())
k = int(input())
var = s[k-1]
ans = ["*" if i != var else i for i in s]

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

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:
        print("*", end="")
    else:
        print(S[i], end="")

print()

Submission status: Accepted

Solution code:
N = int(input())
S = list(str(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 = input()
K = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input()) - 1
output = []
for c in S:
    if c == S[K]:
        output.append(c)
    else:
        output.append('*')
print(''.join(output))

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    s = input().rstrip()
    k = int(input()) 
    l = s[k-1]
    char_array = [None] * n
    for i, c in enumerate(s):
        if c != l:
            char_array[i] = '*'
        else:
            char_array[i] = l
    print(''.join(char_array))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

rest_char = S[K]

for i in range(len(S)):
    if S[i] != rest_char:
        S[i] = '*'

print("".join(S))

Submission status: Accepted

Solution code:
#!/usr/bin/env python
N = int(input())
S = input()
K = int(input())

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

Submission status: Accepted

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

sk = S[K-1]

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


print(''.join(S))

Submission status: Accepted

Solution code:
from sys import stdin
import re

n = int(stdin.readline().rstrip())
s = stdin.readline().rstrip()
k = int(stdin.readline().rstrip())

c = "[^"+s[k-1]+"]"

ans = re.sub(c, '*', s)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
S=input()
K=int(input())
r = S[K-1]
Ans = []
for i in S:
    if i != r:
        Ans.append("*")
    else:
        Ans.append(i)
print(''.join(Ans))

Submission status: Accepted

Solution code:
N = int(input())
S = input().rstrip()
K = int(input())
char = S[K-1]
answer = ["*"]*N
next_index = 0
index_list = []
for i in range(N):
    now = S.find(char, next_index)
    if now == -1:
        break
    next_index = now + 1 
    index_list.append(now)
for i in index_list:
    answer[i] = char
print(*answer, sep="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
strlist = list(input())
K = int(input())
target = strlist[K-1]
for i in range(int(N)):
    if strlist[i] != target:
        strlist[i] = '*'

print(''.join(strlist))

Submission status: Accepted

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

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

print("".join(S_list))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = b
for i in range(a):
  if(b[i] != b[c - 1]):
    ans = ans.replace(b[i],'*')
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=input()
k=int(input())
c=s[k-1]
sl=list(s)
for i in range(n):
	if sl[i] != c:
		sl[i] = '*'

print("".join(sl))

Submission status: Accepted

Solution code:
N = int(input())
s = input()
k = int(input())
l = []
for i in range(N):
    l.append(s[i])

for i in range(N):
    if l[i] != s[k - 1]:
        l[i] = "*"
print(*l,sep="")

Submission status: Accepted

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

Submission status: Accepted

Solution 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] = "*"

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

Submission status: Accepted

Solution code:
N=input()
s=list(input())
idx=int(input())
z=s[idx-1]
for it in s:
    if it == z:
        print(it,end="")
    else:
        print("*",end="")
print()

Submission status: Accepted

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

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

print(out)

Submission status: Accepted

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

x = S[K-1]

for i in range(len(S)):
    if not S[i] == x:
        S = S[:i] + "*" + S[i+1:]

print(S)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
target = S[K-1]
S_list = [c for c in S]
for i,char in enumerate(S_list):
    if char != target:
        S_list[i] = "*"
print("".join(S_list))

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 += s[i]
    else:
        a += "*"
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

kome = S[K - 1]

for i in range(N):
    if S[i] != kome:
        S[i] = "*"

s = ""
for i in range(N):
    s += str(S[i])
    
print(s)

Submission status: Accepted

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

temp=s[k-1]
#print(temp)

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

print(ans)

Submission status: Accepted

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

t = S[K - 1]

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

Submission status: Accepted

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

string = S[K - 1]

new_string = ""
for i, v in enumerate(S):
    if S[i] != string:
        new_string += "*"
    else:
        new_string += S[i]

print(new_string)

Submission status: Accepted

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

Submission status: Accepted

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

target = k[s -1]

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

Submission status: Accepted

Solution code:
import re

def solve():
  N = int(input())
  S = input()
  K = int(input())
  return re.sub('[^' + S[K - 1] + ']', '*', S)

print(solve())

Submission status: Accepted

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

Submission status: Accepted

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

for s in S:
  if S[K-1] != s:
    S  = S.replace(s,"*")

print(S)

Submission status: Accepted

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

char = s[k-1]
# print(char)

result=''
for i in range(n):
    if s[i] != char:
        result += '*'
    else:
        result += s[i]

print(result)

Submission status: Accepted

Solution code:
import re

N = int(input())
S = input()
K = int(input())
print(re.sub(r'[^{}]'.format(S[K-1]), '*', S))

Submission status: Accepted

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


print(''.join(list(map(lambda x : x if x == S[K-1] else '*', S))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=3
string_list=[input() for i in range(n)]
c=''
for strng in string_list[1]:
    if strng==string_list[1][int(string_list[2])-1]:
        c+=strng
    else:
        c+='*'
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys,re
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    S = lines.pop(0)
    K = int(lines.pop(0))
    c = S[K-1:K]
    print(re.sub(r"[^{}]".format(c),'*',S))

lines = [x.strip() for x in sys.stdin.readlines()]
solve(lines)

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:
n = int(input())
s = input()
k = int(input())
s = list(s)
tmp = s[k-1]
for i in range(n):
  if tmp != s[i]:
    s[i] = '*'
    
s = ''.join(s)
print(s)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/tenka1-2019-beginner
# -*- coding: utf-8 -*-

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

result = ""
for i in s:
    if i is s[k-1]:
        result += i
    else:
        result += "*"

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    _ = int(input())
    s = input()
    k = int(input())
    ans = ''
    r = s[k - 1]
    for char in s:
        if char == r:
            ans += char
        else:
            ans += '*'

    print(ans)


main()

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input()) - 1
tx = S[K]
s = []
for i in range(N):
    if S[i] != tx:
        s.append('*')
    else:
        s.append(S[i])
print(''.join(s))

Submission status: Accepted

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

from sys import stdin

def main():
    _ = stdin.readline().rstrip()
    s = stdin.readline().rstrip()
    k = int(stdin.readline())

    target = s[k-1]
    ans = ''

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

if __name__=='__main__':
    main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

print(new_S)

Submission status: Accepted

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

ka = S[K-1]

for i in range(N):
    if S[i] != ka:
        S[i] = "*"

print("".join(S))

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def ii(): return int(stdin.readline())
def li(): return map(int, stdin.readline().split())
def ns(): return stdin.readline().rstrip()
N = ii()
S = ns()
K = ii()
sym = S[K-1]

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
a = S[K-1]
ans = ''
for x in S:
    if x == a:
        ans += a
    else:
        ans += '*'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str_len = int(input())
input_str = input()
target_char_num = int(input())
target_char = input_str[target_char_num-1]

#print(str_len,input_str,target_char)

print_str = ''

for i in range(str_len):
  if input_str[i] != target_char:
    print_str = print_str + '*'
  else:
    print_str = print_str + target_char

print(print_str)

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.append('*')
	else:
		ans.append(char)


print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

c = s[k-1]

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

for j in s:
    print(j,end = "")

Submission status: Accepted

Solution code:
# coding: utf-8
N = int(input())
S = list(input())
K = int(input()) - 1
str = S[K]
print(''.join([i if i == str else '*' for i in S]))

Submission status: Accepted

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

r = s[k - 1]
ans = ''
for i, v in enumerate(s):
    if v != r:
        ans += '*'
    else:
        ans += v

print(ans)

Submission status: Accepted

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

key = S[K]
S_list = list(S)
for i in range(N):
    if S_list[i] != key:
        S_list[i] = "*"

ans = ""
for i in S_list:
    ans += i
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

error = s[k-1]

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

Submission status: Accepted

Solution code:
# coding: utf-8
import re
import bisect
from datetime import datetime as dt
N = input()
S = raw_input()
K = input()
a = S[K - 1]
b = ''
for i in range(len(S)):
    if S[i] != a:
        b += '*'
    else:
        b += a
print b

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
moji = S[K-1]
for i in range(len(S)):
    if S[i] != moji:
        S = S.replace(S[i],"*")
print(S)

Submission status: Accepted

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

target = s[k-1]

print("".join(c if c == target else '*' for c in list(s)))

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 += moji
  else:
    ans += '*'
print(ans)

Submission status: Accepted

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

let = s[k-1]
new = ''
for i in s:
    if i == let:
        new += i
    else:
        new+= "*"

print(new)

Submission status: Accepted

Solution code:
import re

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

r = s[k-1]
print(re.sub('[^'+ r +']', '*', s))