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

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

Submission status: Accepted

Solution code:
#d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
import math
#n=int(input())
#li=input().split()
#S=input()
#import fractions
#lis=list(map(int,input().split()))

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

l=s[k-1]

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


print(ans)

Submission status: Accepted

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

a = S[K-1]

aa = S.split(a)
output = ''
for i in range(len(aa)):
    output += '*' * len(aa[i])+a

print(output[:-1])

Submission status: Accepted

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

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

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

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] = '*'
ans  = ''.join(S)
print(ans)

Submission status: Accepted

Solution code:
import sys
import numpy as np

readInt = lambda: int(sys.stdin.readline())
readIntN = lambda: [int(v) for v in sys.stdin.readline().split(' ')]

n = readInt()
s = sys.stdin.readline().strip()
k = readInt()

v = s[k - 1]
ss = list(s)
for i,c  in enumerate(s):
    if c != v:
        ss[i] = '*'
ret = ''.join(ss)
print(ret)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline())
S = sys.stdin.readline().rstrip()
K = int(sys.stdin.readline())


temp = S[K-1]

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

print(ans)

Submission status: Accepted

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


main()

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
s = input()
k = int(input())
ans = ""
for i in range(n):
    if s[i] != s[k-1]:
        ans += "*"
    else:
        ans += s[i]
print(ans)

Submission status: Accepted

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

char = S[K-1]
lst = []
for s in S:
    if s == char:
        lst.append(char)
    else:
        lst.append('*')

print(''.join(lst))

Submission status: Accepted

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

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

print(''.join(ans))

Submission status: Accepted

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

t = s[k-1]
s2 = []
for i, c in enumerate(s):
    if c != t:
        s2.append("*")
    else:
        s2.append(c)
print("".join(s2))

Submission status: Accepted

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

Submission status: Accepted

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

output = ''
target_char = s[k - 1]

for char in s:
    if char == target_char:
        output += char
    else:
        output += '*'

print(output)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(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())

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import math


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


ans = ""

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
s=input().rstrip()
s=[i for  i in s]
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())

no_replace_char = S[K-1]

output = ""
for c in S :
    if (c == no_replace_char) :
        output += c
    else :
        output += "*"

print(output)

Submission status: Accepted

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

c = s[k-1]
s_d = ""

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

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

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

print(p)

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

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

print(retval)

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:
from sys import exit

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

s = S[K - 1]

ans = ''

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

print(ans)

Submission status: Accepted

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

print(*[c if c == S[K-1] else '*' for c in S], sep='')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = list(input())
c = int(input())
d = b[c-1]

for i in range(a):
    if b[i] == d:
        print(d,end = "")
    else:
        print("*",end = "")

print("")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

s = S[K-1]

R = "".join([c if c == s else "*" for c in S])

print(R)

Submission status: Accepted

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

Submission status: Accepted

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

a = S[K-1]

ans = ''.join(['*' if x != a else x for x in S])

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

    mozi = s[k-1]
    # print(n, s , k, mozi)
    result = ''
    for c in list(s):
        if c == mozi:
            result += mozi
        else:
            result += '*'
    print(result)
    


main()

Submission status: Accepted

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

char = S[K - 1]

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

Submission status: Accepted

Solution code:
#coding: utf-8
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:
def MI(): return map(int, input().split())
def II(): return int(input())
def IS(): return input()
def LI(): return list(map(int, input().split()))

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

Submission status: Accepted

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

a = s[k - 1]

result = [a if s[i] == a else '*' for i in range(n)]
print(''.join(result))

Submission status: Accepted

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

text = ""
for i in range(len(S)):
  if S[i] == S[K-1]:
    text += S[i]
  else:
    text += "*"

print(text)

Submission status: Accepted

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

Submission status: Accepted

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

def readInts():
  return [int(s) for s in input().split(" ")]

def main():
  N = readInts()[0]
  S = input()
  K = readInts()[0]
  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 = int(input())
S = list(input())
k = int(input())
s = S[k-1]
for i in range(n):
  if S[i] != s:
    S[i] = '*'

print(''.join(S))

Submission status: Accepted

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

ans = list(S)
c = S[K-1]

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

print(''.join(ans))

Submission status: Accepted

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

t = S[K-1]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

target = s[k-1]

ans = ""

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

print(ans)

Submission status: Accepted

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

sList = list(S)
notReplace = sList[K-1]

for i in range(len(sList)):
    if sList[i] != notReplace:
        sList[i] = "*"

print("".join(sList))

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ns():
    import sys
    return map(int, sys.stdin.readline().split())
  
def ss():
    import sys
    return list(sys.stdin.readline().strip())
  
N, = ns()
S = ss()
K, = ns()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())

S = input()

K = int(input())

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

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

ans = ''.join(ans)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

s = S[K-1]

txt = ''

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

print(txt)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

    print(''.join(chars))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

tar = S[K - 1]

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

print(''.join(res))

Submission status: Accepted

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

ans = ""

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

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
S=input()
K=int(input())
#A,B,C=map(int,input().split())
#A=list(map(int,input().split()))
T=""
for i in S:
    if i!=S[K-1]:
        T+="*"
    else:
        T+=S[K-1]
print(T)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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 = [c for c in input()]
K = int(input())

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

Submission status: Accepted

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

if __name__ == '__main__':
	main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

s_k = S[K-1]

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

print(s)

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/tenka1-2019-beginner/tasks/tenka1_2019_b

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

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

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

print(Sprc)

Submission status: Accepted

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

x = s[k-1]

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

print(ans)

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

Submission status: Accepted

Solution code:
# Tenka1 Programmer Beginner Contest 2019
# https://atcoder.jp/contests/tenka1-2019-beginner
# 
# 

import sys

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = s_inpl()   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = inpl()	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

import math
import copy
from collections import defaultdict
from collections import Counter
from collections import deque
# 直積 A={a, b, c}, B={d, e}:のとき，A×B={(a,d),(a,e),(b,d),(b,e),(c,d),(c,e)}: product(A, B)
from itertools import product
# 階乗 P!: permutations(seq), 順列 {}_len(seq) P_n: permutations(seq, n)
from itertools import permutations
# 組み合わせ {}_len(seq) C_n: combinations(seq, n)
from itertools import combinations
from bisect import bisect_left, bisect_right
# import numpy as np

# 四方向
dy = [0, 0, 1, -1]
dx = [1, -1, 0, 0]
INF = float("inf")

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

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

ssi = S[K-1]

ans = ""

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

print(ans)

Submission status: Accepted

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

swap = S[K-1]

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

print(''.join(S))

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

tmp = s[K-1]

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

Submission status: Accepted

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

print(res)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

sk = S[K-1]

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

Submission status: Accepted

Solution code:
from functools import reduce
import math

def main():
    # 文字列の2進数を数値にする
    # '101' → '5'
    # 文字列の頭に'0b'をつけてint()にわたす
    # binary = int('0b'+'101',0)

    # 2進数で立っているbitを数える
    # 101(0x5) → 2
    # cnt_bit = bin(5).count('1')
    
    # N! を求める
    # f = math.factorial(N)
    
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    INF = float("inf")
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    N = int(input().rstrip())
    S = list(_ for _ in input())
    K = int(input().rstrip())
    c = S[K-1]
    for i in range(N):
        if(S[i]!=c):
            S[i] = '*'
        
    print(''.join(S))
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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


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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

diff = set(S) - set(S[K - 1])
#print(diff)
for d in diff:
	S = S.replace(d, "*")
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] = "*"

print("".join(s))

Submission status: Accepted

Solution code:
def ans():

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

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

ans()

Submission status: Accepted

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

Submission status: Accepted

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

target_c = S[K-1]

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

print(out_str)

Submission status: Accepted

Solution code:
#!/snap/bin/pypy3

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

    char = S[K-1]

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


if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

#n=list(map(int,input().split()))
#x=int(input())
n=int(input())
s=input()
k=int(input())
s2=""
ch=s[k-1]
for a in range(len(s)):
    if ch==s[a]:
        s2+=s[a]
    else:
        s2+="*"
print(s2)

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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