Problem:


Score : 200 points

Problem Statement

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

Constraints

1 \leq K \leq N\leq 10

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

N and K are integers.

Input

Input is given from Standard Input in the following format:

N
S
K

Output

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

Sample Input 1

5
error
2

Sample Output 1

*rr*r

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

Sample Input 2

6
eleven
5

Sample Output 2

e*e*e*

Sample Input 3

9
education
7

Sample Output 3

******i**



Sample input:
5
error
2


Sample output:
*rr*r

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
result = []

for x in s:
    if x != s[k-1]:
        result.append("*")
    else:
        result.append(x)

print("".join(result))

Submission status: Accepted

Solution code:
N, S, K = [input() for i in range(3)]

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

Submission status: Accepted

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

temp = s[k-1]
ans = s.replace(temp, '0')

for i in ans:
    if i != '0':
        ans = ans.replace(i, '*')

print(ans.replace('0',temp))

Submission status: Accepted

Solution code:
A = int(input())
B = input()
C = int(input())
mark = B[C-1]
for i in range(A):
  if B[i] != mark:
    B = B.replace(B[i], '*', 1)
    
 
print(B)

Submission status: Accepted

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

change_word = S[K-1]
changed_S = ''

for w in S:
    if(w == change_word):
        changed_S += w
    else:
        changed_S += '*'

print(changed_S)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(T)

Submission status: Accepted

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

c = (list(s))[k-1]

def sub(x):
    global c
    if x != c:
        return "*"
    else:
        return x

ans = "".join(map(sub, s.strip()))

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 =""
for j in s:
    ans += j
print(ans)

Submission status: Accepted

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

ans = []
for c in S:
    if c != S[K]:
        ans.append('*')
    else:
        ans.append(c)

print(''.join(ans))

Submission status: Accepted

Solution code:
def read_input():
    n = int(input())
    s = input().strip()
    k = int(input())

    return n, s, k



if __name__ == '__main__':
    n, s, k = read_input()

    target_char = s[k - 1]

    result = ''
    for c in s:
        if c != target_char:
            result += '*'
        else:
            result += c

    print(result)

Submission status: Accepted

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

import re

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
_, e, f = [input() for _ in range(3)]

print("".join([char if char == e[int(f)-1] else "*" for char in e]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(atai)

Submission status: Accepted

Solution code:
A =int(input())
B=input()
c=int(input())
d=B[c-1]
E=""
for i in range(A):
    if B[i]==d:
        E=E+d
    else:
        E=E+"*"
print(E)

Submission status: Accepted

Solution code:
import re
n = input()
s = input()
k = int(input())
tmp = re.sub(r'[a-z]', "*", s.replace(s[k-1], "0"))
print(tmp.replace("0", s[k-1]))

Submission status: Accepted

Solution code:
import sys

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

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

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

Submission status: Accepted

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

key = S[K-1]
stk = ""
for i in S:
    if(i == key):
        stk += i
    else:
        stk += '*'
print(stk)

Submission status: Accepted

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

s = S[K-1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num=int(input())
origin=input()
per=origin[int(input())-1]

for i in range(num):
    if origin[i] != per and origin[i] != "*":
        origin = origin.replace(origin[i], "*")
        
print(origin)

Submission status: Accepted

Solution code:
inp =input()
li = list(input())
num = int(input())
key = li[num-1]
a = []
for q in li:
    if q != key:
        a.append('*')
    else:
        a.append(q)
x = ''.join(a)
print(x)

Submission status: Accepted

Solution code:
import re

_ = int(input())
s = input()
k = int(input())

k_char = s[k-1]
print(re.sub('[a-z]', '*', s.replace(k_char, '-')).replace('-', k_char))

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
sa = s[k - 1: k]
sl = len(s)
sli = list(s)
hey = []
for sli in sli:
    if sli == sa:
        hey.append(sli)
    else:
        hey.append("*")
hey = "".join(hey)
print(hey)

Submission status: Accepted

Solution code:
gomi = input()
a = input()
b = int(input())
c = []
for i in range(len(a)):
    if a[b-1] == a[i]:
        c.append(a[i])
    else:
        c.append("*")

print(''.join(c))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print "".join(s)

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())
S = list(input())
K = int(stdin.readline().rstrip())
for s in S:
    if s != S[K-1]:
        print('*', end="")
    else: print(s, end="")

Submission status: Accepted

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

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

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

print(result[1:])

Submission status: Accepted

Solution code:
N=int(input())
S=str(input())
n=int(input())
d=S[n-1]
a=""
for i in S:
    if i!=d:
        a+="*"
    elif i==d:
        a+=i
print(a)

Submission status: Accepted

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

# 整数の入力
N = int(input())
S = str(input())
K = int(input())

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

Submission status: Accepted

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

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

print(''.join(s))

Submission status: Accepted

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

x = s[k-1]

for i in range(n):
    if s[i] != x:
        s = s.replace(s[i], "*")

print(s)

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
m = s[k-1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

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

T = S[K-1:K]

print(re.sub('[^' + T + ']',"*",S))

Submission status: Accepted

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

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

a = ''

for i in range(len(S)):
    if S[i] == S[K]:
        a += S[i]
    else:
        a += '*'

print(a)

Submission status: Accepted

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

s = S[K-1]
S_ = ''
for i,n in enumerate(S):
    if n==s:
        S_+=S[i]
    else:
        S_+='*'
print(S_)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 20 20:18:25 2019

@author: screamLab
"""

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

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

Submission status: Accepted

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

X=[]*N

for i in S:

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
argN = int(input())
argS = input()
argK = int(input())

aryS = list(argS)

for i in range(argN):
  if aryS[i] == aryS[argK-1]:
    pass
  else:
    aryS[i] = "*"
print("".join(aryS))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
s = str(input())
k = int(input())
"""
n = 7
s = "djfsfok"
k = 3
"""
index_num = [n for n, v in enumerate(s) if v == s[k-1]]
ans = list("*"*n)
index_num = list(index_num)
for i in range(0, len(index_num)):
    ans[index_num[i]] = s[k-1]
print("".join(ans))

Submission status: Accepted

Solution code:
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 = input()
K = int(input())
 
cha = S[K-1]
list_ = [s for s in S]
for i in range(N):
  if cha != S[i]:
    list_[i] = "*"
print("".join(list_))

Submission status: Accepted

Solution code:
input1 = input()
input2 = list(input())
input3 = input()
for i in range(0,len(input2)):
    if input2[i] != input2[int(input3)-1]:
        input2[i] = "*"
print("".join(input2))

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:
import re
N = int(input())
S = input()
K = int(input())

w = S[K-1]
print(re.sub("[^#]", "*", S.replace(w, "#")).replace("#", w))

Submission status: Accepted

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

moji = S[K-1]

for i in range(N):
  if S[i] != moji:
    S = S.replace( S[i] , '*' )

print(S)

Submission status: Accepted

Solution code:
from sys import stdin
import re

n = [int(x) for x in stdin.readline().rstrip().split()]
s = stdin.readline().rstrip().split()
s = s[0]
k = [int(x) for x in stdin.readline().rstrip().split()]
k = k[0]

ast = ''
for i in range(len(s)):
    if i+1 == k:
        ast = s[i]

print(re.sub('[^' + ast + ']', '*', s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
S=list(input())
Kkari=int(input())
K=Kkari-1
t=0
while t<N:
    if S[t]!=S[K]:
        S[t]='*'
    t=t+1
print(''.join(S))

Submission status: Accepted

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

ch = s[k - 1]

for c in s:
    if (c == ch):
        print(c, end="")
    else:
        print("*", end="")

Submission status: Accepted

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

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

S = "".join(S)

print(S)

Submission status: Accepted

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

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

str_changed = "".join(str_list)
print(str_changed)

Submission status: Accepted

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


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

char = S[K - 1]
# print(char)

ret = ''

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

print(ret)

Submission status: Accepted

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

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:
n = int(input())
S = list(input())
k = int(input())
s = S[k-1]

A = []
for i in range(n):
    a = S[i]
    if a != s:
        A.append("*")
    else:
        A.append(s)

print(*A, sep = "")

Submission status: Accepted

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

Submission status: Accepted

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

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

    print(''.join(S))


if __name__ == '__main__':
    main()

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

target_cha = s[k - 1]

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

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
from re import sub

readline = stdin.readline

_ = readline()
s = readline().rstrip()
k = int(readline())

print(sub('[^{}]'.format(s[k-1]), '*', s))

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
K = int(input())
a = S[K-1]
T=[]

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

T = ''.join(S)

print(T)

Submission status: Accepted

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

ans = []
moji = S[K-1]

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

ans = ','.join(ans)
ans = ans.replace(',', '')

print(ans)

Submission status: Accepted

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

a = S[K-1]

answer = ''
for i,j in enumerate(S):
  if j == a:
    answer += j
  else:
    answer += '*'

print(answer)

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:
n = int(input())
s = input().strip()
k = int(input())

for _s in s:
  if _s != s[k-1]:
    print('*', end='')
  else:
    print(_s, end='')
print()

Submission status: Accepted

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

list2 = []
for j in list1:
    if j == list1[K-1]:
        list2.append(list1[K-1])
    else:
        list2.append("*")


ans = ''.join(list2)
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]:
        pass
    else:
        S[i] = '*'

print(''.join(S))

Submission status: Accepted

Solution code:
n = int(input())
k = input()
l = int(input())
m = k[l-1]
list = []
for i in range(len(k)):
  if k[i] == m:
    list.append(m)
  else:
    list.append("*") 
print(''.join(list))

Submission status: Accepted

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

print(c)

Submission status: Accepted

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

str_list = list(S)

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

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

Submission status: Accepted

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

s=input()

k=input()
k=int(k)

tmp = s[k-1]
tmp_list=list(s)

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

aaa = "".join(tmp_list)
print(aaa)

Submission status: Accepted

Solution code:
n=int(input())
s=input()
k=int(input())
S=s[k-1]

for i in range(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())

S_list = list(S)

moji = S_list[K-1]

for i in range(len(S_list)):
    if S_list[i]!=moji:
        S_list[i]="*"
print("".join(S_list))

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

ch = S[K-1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

t = S[K - 1]
for s in 'abcdefghijklmnopqrstuvwxyz':
    if s != t:
        S = S.replace(s, '*')
        
print(S)

Submission status: Accepted

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

c = S[K-1]

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

Submission status: Accepted

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

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

k_chr = S[K-1]
output = ''

for char in S:
    if char == k_chr:
        output += k_chr
    else:
        output += '*'

print (output)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

ans = []

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

Submission status: Accepted

Solution code:
import re
N = input()
S = input().strip()
K = int(input())
print(re.sub("[^" + str(S[K - 1]) + "]", "*", S))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
l = []
a = ''

for i in range(n):
    l += s[i]

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

for i in range(n):
    a += ''.join(l[i])
    
print(a)

Submission status: Accepted

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

ans = []
a = S[K-1]

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

mojiretu = ' '

for x in ans:
    mojiretu += x
    
print(mojiretu)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

a = s[k-1]

s_list = list(s)

for i in range(n):
    if s_list[i] != a:
        s_list[i] = "*"

s1 = "".join(s_list)

print(s1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

    target_char = S[K - 1]
    result_list = []

    for s in S:
        if target_char != s:
            result_list.append("*")
        else:
            result_list.append(s)

    print("".join(result_list))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

t = S[K-1]

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

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:
N = int(input())
S = input()
K = int(input())
lst = list(S)
for i in range(N):
  if lst[i] == lst[K-1]:
    pass
  else:
    lst[i] = "*"
print("".join(lst))

Submission status: Accepted

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

rep = s[k-1]
s = [x if x == rep else "*" for x in s]

print("".join(s))

Submission status: Accepted

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

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

print(new_s)

Submission status: Accepted

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

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

t = s[k-1]

s_list = list(s)

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

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

Submission status: Accepted

Solution code:
#B - *e**** ********e* *e****e* ****e**

len_of_s = int(input())
s = input()
k = int(input())

remain = s[k-1]
s_list = [i for i in s]

for i in range(len_of_s):
	if s_list[i] != remain:
		s_list[i] = "*"

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x=s[K-1]

for i in range(N):
    if s[i]!=x:
        s[i]="*"

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import re

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

save = []

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

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

Submission status: Accepted

Solution code:
def main(word, num):
    strs = list(word)
    target = strs[num-1]

    new_strs = []
    for s in strs:
        if s != target:
            s = "*"
        new_strs.append(s)

    return ''.join(new_strs)


if __name__ == "__main__":
    input()
    word = input()
    num = int(input())
    print(main(word, num))

Submission status: Accepted

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

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

Submission status: Accepted

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

k_char = S[K-1]
S_aranged = ""

for i in S:
    if i != k_char:
        S_aranged += "*"
    else:
        S_aranged += k_char

print(S_aranged)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import re

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

listS = list(S)
result = re.sub('[^'+listS[K-1]+']', '*', S)
print(result)

Submission status: Accepted

Solution code:
jhj = int(input())
moji = list(input())
k = int(input())
o = moji[k - 1]
for c in range(jhj):
    if moji[c] == o:
        pass
    else:
        moji[c] = "*"
print("".join(moji))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

i = K -1
char = S[i]
line = ""

for ii in range(len(S)):
    if char != S[ii]:
        line = line + "*"
    else:
        line = line + S[ii]


print(line)

Submission status: Accepted

Solution code:
N = int(input())
S = input()
K = int(input())
r = S[K-1]
print(''.join(list(map(lambda x: '*' if x!=r else r,S))))

Submission status: Accepted

Solution code:
x = int(input());
li = list(input());
y = int(input());

for i in range(len(li)):
    if str(li[i]) != str(li[y-1]):
        li[i] = '*';
for i in range(len(li)):
      print(li[i], end="");

print();

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#B - *e**** ********e* *e****e* ****e**
n = int(input())
s = list(input())
k = int(input())
kome = s[k-1]
for i in range(n):
    if s[i] != kome:
        s[i] = '*'
print(''.join(s))

Submission status: Accepted

Solution code:
a=int(input())
b=input()
c=int(input())
word=b[c-1]
d=[]
for i in range(a):
    if b[i]!=word:
        d.append("*")
    else:
        d.append(b[i])
for s in d:
  print(s, end ="")

Submission status: Accepted

Solution code:
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque, OrderedDict
from copy import deepcopy
from fractions import gcd
from functools import lru_cache, reduce
from math import ceil, floor
from sys import setrecursionlimit

import heapq
import itertools
import operator


# globals
inf = float('inf')
N = 0
S = ""
K = 0


def set_inputs():
    global N, S, K
    N = get_int()
    S = get_str()
    K = get_int()
    return


def main():
    setrecursionlimit(100000)
    set_inputs()
    # ----------MAIN----------
    ans = []
    C = S[K - 1]
    for c in S:
        if c != C:
            ans.append("*")
        else:
            ans.append(c)
    print("".join(ans))
    return


def get_int():
    return int(input())


def get_float():
    return float(input())


def get_str():
    return input().strip()


def get_li():
    return [int(i) for i in input().split()]


def get_lf():
    return [float(f) for f in input().split()]


def get_lc():
    return list(input().strip())


def get_data(n, types, sep=None):
    if len(types) == 1:
        return [types[0](input()) for _ in range(n)]
    return list(zip(*(
        [t(x) for t, x in zip(types, input().split(sep=sep))]
        for _ in range(n)
    )))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import copy 

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

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

Submission status: Accepted

Solution code:
from sys import stdin
n = int(stdin.readline().rstrip())
S = list(stdin.readline().rstrip())
k = int(stdin.readline().rstrip())
c = S[k-1]
for i, s in enumerate(S):
    if s != c:
        S[i]='*'
print(''.join(S))