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:
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    s = input()
    k = int(input())
    ans = ''
    kth_s = s[k - 1]

    for si in s:
        if si != kth_s:
            ans += '*'
        else:
            ans += si

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
B - *e**** ********e* *e****e* ****e**
https://atcoder.jp/contests/tenka1-2019-beginner/tasks/tenka1_2019_b

"""
import sys


def solve(N, S, K):
    ch = S[K-1]
    ans = [['*', s][ch==s] for s in S]
    return ''.join(ans)


def main(args):
    N = int(input())
    S = input()
    K = int(input())
    ans = solve(N, S, K)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    _ = int(stdin.readline().rstrip())
    S = stdin.readline().rstrip()
    K = int(stdin.readline().rstrip())
    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 = input()
K = int(input())

C = S[K-1]

ans = ""

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import re

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

target=s[k-1]

s=s.replace(target, '0')
s=re.sub('[a-z]', "*", s)
s=s.replace('0', target)
print(s)

Submission status: Accepted

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

check = S[K-1]

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

Submission status: Accepted

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

Submission status: Accepted

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

slist = list(s)
char = slist[k-1]

print(''.join([c if c == char else '*' for c in slist]))

Submission status: Accepted

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

target = S[K - 1]

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

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:
input()
s=input()
k=s[int(input())-1]
print(''.join(['*'if c!=k else c for c in 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],'*')
        continue

print(S)

Submission status: Accepted

Solution code:
import re

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

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

Submission status: Accepted

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

s2 = [["*", i][i == s[k-1]] for i in s]
print(("").join(s2))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

target_string = S[K-1]

ans = S[:]
for i in S:
  if i != target_string:
    ans = ans.replace(i,"*")

print("{}".format(ans))

Submission status: Accepted

Solution code:
#coding:utf-8

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

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
e = S[K-1]
ans = []
for c in S:
    if c != e:
        ans.append("*")
    else:
        ans.append(c)
print(*ans, sep='')

Submission status: Accepted

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

w = s[k - 1]
print("".join(list(map(lambda x: "*" if x != w else x, s))))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=list(str(input()))
k=int(input())
a=[]
for i in range(n):
    if s[k-1]==s[i]:
        a.append(s[k-1])
    else:
        a.append("*")
b="".join(a)
print(b)

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

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

Submission status: Accepted

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

s_k = s[k-1]
ans = ""
for i in range(len(s)):
    if s[i] != s_k:
        ans += "*"
    else:
        ans += s[i]
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())

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

Submission status: Accepted

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

Submission status: Accepted

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

selected_s = S[K-1]

for i in range(N):
  if S[i] is not selected_s:
    s = "*"
    S[i] = "*"
print("".join(S))

Submission status: Accepted

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

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] = '*'
    else:
        pass

ans = ''.join(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())

moji = S[K-1]

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
s=input()
k=int(input())
s0 = s[k-1]
ans = ''
i = 0
while i < len(s):
    if s[i] != s0:
        ans += '*'
    else:
        ans += s[i]
    i += 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

print(result)

Submission status: Accepted

Solution code:
N=int(input())
S=list(input())
K=int(input())
count=0
x=len(S)
for i in range(0,x):
    if(S[i]!=S[K-1]):
        count=count+1
        S[i]="*"
print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n, s, k = [input() for _ in range(3)]
n, k = int(n), int(k) - 1
t = s[k]
print(''.join([c if c == t else '*' for c in s]))

Submission status: Accepted

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

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

print("".join(sl))

Submission status: Accepted

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

Submission status: Accepted

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

n = S[K-1]
ans = ""
for i in range(N):
  if S[i] != n:
    ans += "*"
  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 range(0,N):
  if S[i]!=s:
    S=S.replace(S[i],'*')
    
    
print(S)

Submission status: Accepted

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

Submission status: Accepted

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





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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re
# イテレーションのため
input()
S = input()
K = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

c = s[k-1]

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

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

Submission status: Accepted

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

Submission status: Accepted

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

c = s[k]

out = ""

for i in s:
    if i == c:
        out += i
    else:
        out += "*"

print(out)

Submission status: Accepted

Solution code:
n = int(input())
list =list(input())
m = ""
j = int(input()) - 1
for i in range(n):
  if list[i] == list[j]:
    m += list[j]
  else:
    m += "*"
print(m)

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 = s[k - 1]
for i in range(n):
    if s[i] != change:
        print("*", end="")
    else:
        print(s[i], end="")
    if i == n - 1:
        print()

Submission status: Accepted

Solution code:
user_input=[]
for i in range(3):
    user_input.append(input())
N=int(user_input[0])
S=user_input[1]
K=int(user_input[2])-1

S_list=[]
for i in S:
    S_list.append(i)

obj=S_list[K]
for i in range(N):
    if S_list[i] != obj:
        S_list[i]='*'
S_after=''.join(S_list)
print(S_after)

Submission status: Accepted

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

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

Submission status: Accepted

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

a = S[K-1]

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

print(output)

Submission status: Accepted

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

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

print(_)

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

x = s[k-1]
for i in range(n):
  if s[i] == x:
    print(x, end='')
  else:
    print('*', end='')

Submission status: Accepted

Solution code:
import re
input()
s = input()
k = s[int(input()) -1]

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

Submission status: Accepted

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

for i in range(N):
    
    if S[i]!=moji:
        S[i]="*"
mojiretu=""
for x in S:
  mojiretu+=x
print(mojiretu)

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime,random
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for s in S:
    
    if(s != c):
        result += '*'
    
    else:
        result += s

print(result)

Submission status: Accepted

Solution code:
N = input()
S = input()
K = input()
c = S[int(K)-1]
r = ''
for t in S:
  if t == c:
    r += c
  else:
    r += '*'

print(r)

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:
input()
S=input()
k=int(input())
i=S[k-1]
for s in S:print(s if s==i else "*",end="")

Submission status: Accepted

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

_ = ""
for s in S:
  if s is not S[K-1]:
    _ = _ + "*"
  else:
    _ = _ + s
print("".join(_))

Submission status: Accepted

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

target_char = s[k-1]

out = ""
for s_i in s:
	if s_i != target_char:
		out += "*"
	else:
		out += s_i

print(out)

Submission status: Accepted

Solution code:
N,S,K = [input() for x in [0,1,2]]

c = S[int(K)-1]

ans = ""

for char in S:
    if char == c:
        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(0,n):
    if S[i]==S[k-1]:
        continue
    else:
        S[i]='*'


print(''.join(S))

Submission status: Accepted

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

ans = ''
for s in S:
    if s == S[K]:
        ans += s
    else:
        ans += '*'
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] = '*'
print(''.join(S))

Submission status: Accepted

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

for c in S:
    if c == Kchar:
       res.append(c)
    else:
        res.append("*")

print("".join(res))

Submission status: Accepted

Solution code:
import math
import sys
N = int(input())
s = input()
k = int(input())
t = s[k-1]
u = ""
for i in s:
    if i == t:
        u += i
    else :
        u += '*'
print(u)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(S)

Submission status: Accepted

Solution code:
import re
l = int(input())
ss = input()
n = int(input())-1
s = ss[n]
print(re.sub('[^%s]' % s, '*', ss))

Submission status: Accepted

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

ans = [_ if _ == S[K - 1] else "*" for _ in S]

print("".join(ans))

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
K = int(input())
un_replace_s = S[K-1]
out = "".join([s if s == un_replace_s else "*" for s in S])
print(out)

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:
input()
chars = input()
tg_char = chars[int(input())-1]
print("".join(map(lambda x: "*" if x!=tg_char else x, chars)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
s = input()
k = int(input())
ans = ''
target = s[k-1]
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())
o = ""
x = s[k-1]
for i in s:
    if i != x:
        i = "*"
        o += i
    else:
        o += i
print(o)

Submission status: Accepted

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

Submission status: Accepted

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

s_list = list(s)


#print(s[0])

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

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

Submission status: Accepted

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

Submission status: Accepted

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

c = s[k-1]
rs = ""
for e in s:
    if e == c:
        rs = rs + e
    else:
        rs = rs + '*'
print(rs)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = input()
    K = int(input())
    unchange = S[K-1]
    for i in range(N):
        if S[i] == unchange:
            pass
        else:
            S = S.replace(S[i], '*')
    print(S)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

for c in [chr(i) for i in range(ord('a'), ord('z')+1)]:
    if c == ignore:
        continue
    S = S.replace(c, '*')

print(S)

Submission status: Accepted

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

key = string[k-1]

index_list = [i for i,letter in enumerate(string) if letter == key]

word = ["*" for i in range(len(string))]
for elem in index_list:
	word[elem] = key

word = "".join(word)
print(word)

Submission status: Accepted

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

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

print("".join(txt))

Submission status: Accepted

Solution code:
N=int(input())
S=str(input())
K=int(input())
W=S[K-1]
for i in range(N):
  if S[i]!=W:
    S=S.replace(S[i],'*')
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.append(s[i])
    else:
        ans.append('*')
print(''.join(ans))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

kth_char = S[K-1]

output = ""
for c in S:
    if c != kth_char:
        output += "*"
    else:
        output += c

print(output)

Submission status: Accepted

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

Submission status: Accepted

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

for i,j in enumerate(S):
    if j != S[K-1]:
        S[i] = '*'

print(''.join(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# k番目の文字と異なる文字をすべて*で置き換える
t = s[k-1]
r = ""
for i in s:
  if i not in t:
    r = r + "*"
  else:
    r = r + i
    
print(r)

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import copy

sys.setrecursionlimit(1000000)

# input = sys.stdin.readline

# ~~~~~~~~~~~~~~~~~~~~~_(＾～＾ ｣ ∠)_~~~~~~~~~~~~~~~~~~~~~

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

c = S[K - 1]

ans = ""
for a in S:
    ans += c if a == c else '*'


print(ans)

Submission status: Accepted

Solution code:
# TPBC201B - *e**** ********e* *e****e* ****e**
n = int(input())
s = list(input())
k = int(input())

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
	N = int(input())
	S = input()
	K = int(input())
	token = S[K-1]
	ans = ''
	for i in range(N):
		if(S[i] != token):
			ans+='*'
		else:
			ans+=S[i]

	print(ans)

Submission status: Accepted

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

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

print("".join(S))

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_changed = "".join(S)
print(S_changed)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(S_new)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
d = s[k - 1]
ans = ''
for c in s:
  if c == d:
    ans += c
  else:
    ans += '*'
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] = "*"

S_new = "".join(S)

print(S_new)

Submission status: Accepted

Solution code:
def mask_word(N: int, S: str, K: int)->str:
    return ''.join(c if c == S[K-1] else '*' for c in S)


if __name__ == "__main__":
    N = int(input())
    S = input()
    K = int(input())

    ans = mask_word(N, S, K)
    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] = '*'

ans = ''.join(s)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re;_,s,k=open(0);print(re.sub('[^%s\n]'%s[int(k)-1],'*',s))

Submission status: Accepted

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

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

print(T)

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    S = input()
    K = int(input())
    replace_char = S[K-1]
    ans = []
    for s in S:
        if s == replace_char:
            ans.append(replace_char)
        else:
            ans.append('*')
    print("".join(ans))

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

p = s[k-1]
ans = str()

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
S = [i for i in 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())
ans = ""
for i in range(N):
  if S[i] ==S[K-1]:
    ans += S[i]
  else:
    ans += "*"
print(ans)

Submission status: Accepted

Solution code:
"""
map(int,input().split())

X = input().split()
x = []
for i in range(0,len(X)):
    x.append(X[i])

"""

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

sls = []

for w in S:
    sls.append(w)

getW = S[K]
out = ""

for i in range(0,N):
    if sls[i] != getW:
        sls[i] = "*"
    out += sls[i]


print(out)

Submission status: Accepted

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

check = S[K-1]

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

print(''.join(S))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 21 13:54:29 2019

@author: Yamazaki Kenichi
"""

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

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

Submission status: Accepted

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

Submission status: Accepted

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

char = s[k-1]

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

print("".join(s))

Submission status: Accepted

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

Submission status: Accepted

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

target = s[k-1]

output = []

for i in range(n):
	if s[i]!=target:
		output.append("*")
	else:
		output.append(target)

print("".join(output))

Submission status: Accepted

Solution code:
n = int(input())
s = str(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:
import re

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

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = []

for letter in word:
    if letter == word[k-1]:
        ans.append(letter)
    else:
        ans.append('*')

print(''.join(ans))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
s = list(map(str, s))
k = int(input())
k -= 1

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

print(''.join(s))