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())
t = s[k - 1]
r = ""
for i in s:
    if i == t:
        r = r + i
    else:
        r = r + "*"

print(r)

Submission status: Accepted

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

target = S[K - 1]
ans = ''
for i, c in enumerate(S):
    if c == target:
        ans += c
    else:
        ans += '*'
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 = input()
k = int(input())
q = s[k-1]
ans = ""
for a in s:
    if a != q:
        ans = ans + "*"
    else:
        ans = ans + s[k-1]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

r_c = s[k-1]

res = ""

for c in s:
    if c == r_c:
        res += r_c
    else:
        res += "*"
print(res)

Submission status: Accepted

Solution code:
def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def zeros(n): return [0]*n

class Debug():
    def __init__(self):
        self.debug = True
 
    def off(self):
        self.debug = False
 
    def dmp(self, x, cmt=''):
        if self.debug:
            if cmt != '':
                w = cmt + ': ' + str(x)
            else:
                w = str(x)
            print(w)
        return x

def prob():
    d = Debug()
    d.off()
    N = getInt()
    S = input()
    K = getInt()
    d.dmp((N, S, K),'N, S, K')
    keep = S[K-1]
    newS = ''
    for c in S:
        if c == keep:
            newS += c
        else:
            newS += '*'
    return newS

ans = prob()
print(ans)

Submission status: Accepted

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

for i in s:
  li.append(i)
check = li[k - 1]
for j in range(n):
  if li[j] != check:
    li[j] = "*"
ans = ""
for l in li:
  ans = ans + l
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
S=str(input())
K=int(input())
ans=''
sk=S[K-1]

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
intLength = int(input())
strSentence = input()
intIndex = int(input())

strAnswer = ""
strWord = strSentence[intIndex-1]

for intIdx in range(intLength):
    if strSentence[intIdx] != strWord:
        strAnswer += "*"
    else:
        strAnswer += strWord

print(strAnswer)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(S)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

result = ""
for si in S:
    result += "*" if si != S[K - 1] else si
print(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]:
        print(s[i], end='')
    else:
        print('*', end='')

Submission status: Accepted

Solution code:
N = int(input())
S = str(input())
K = int(input())
#N = 5
#S = "error"
S = list(S)
#K = 2
char = S[K-1]
for i in range(len(S)):
    if S[i] != char:
        S[i] = "*"
print(''.join(S))

Submission status: Accepted

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

diff = s[k - 1]

lis = []

for i in range(n):
  if s[i] != diff:
    lis.append('*')
  else:
    lis.append(diff)

print(''.join(lis))

Submission status: Accepted

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

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

print(rs)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

x=S[K-1]

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

print("".join(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
_,s,k=open(0);print(''.join(t*(t==s[int(k)-1])or'*'for t in s[:-1]))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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:
if __name__=="__main__":
    N = int(input())
    S = input()
    K = int(input())

    match = S[K-1]
    S = list(S)
    for x in range(N):
        if S[x] != match:
            S[x]= '*'
    S = "".join(S)
    print(S)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
print((lambda S,K:''.join(['*',i][i==S[K-1]]for i in S))(input(),int(input())))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

c = s[k-1]
st = ""
for char in list(s):
    if char == c:
        st = st + char
    else:
        st = st + "*"
print(st)

Submission status: Accepted

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

l = list(s)
t = l[k-1]
a = ''

for i in l:
    if i == t:
        a += t
    else:
        a += "*"

print a

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=input()
l=int(input())-1
moji=s[l]
M=["*"]*n

for i in range(n):
  if s[i]==moji:
    M[i]=moji
    
ans=""
for i in range(n):
  ans+=M[i]
  
print(ans)

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

s = S[K-1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input();s=input();k=int(input())
c=""
d=s[k-1]
for i in s:
    if i!=d:
        c+="*"
    else:
        c+=d
print(c)

Submission status: Accepted

Solution code:
from heapq import heappush,heappop
import re

def int_raw():
    return int(input())

def ss_raw():
    return input().split()

def ints_raw():
    return list(map(int, ss_raw()))
INF = 1 << 29


def runLength(in_str):
    kukan = 1
    start = 0
    ret = []
    for i in range(1,len(in_str)):
        if in_str[i-1]!=in_str[i]:
            ret.append([in_str[i-1],kukan,start])
            start = i
            kukan=0
        kukan+=1
    ret.append([in_str[-1],kukan,start])
    return ret

N = int_raw()
S= input()
K = int_raw()
dp = {}

def rec(ss):
    return 0

def main():
    return re.sub("[^"+S[K-1]+"]","*",S)



print(main())

Submission status: Accepted

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

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

Submission status: Accepted

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

s = S[K-1]

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

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:
n = int(input())
s = list(input())
k = int(input())
print("".join(list(map(lambda x: "*" if x!=s[k-1] else x, 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 += i
    else:
        ans += "*"
print(ans)

Submission status: Accepted

Solution code:
import sys

def solve(N, S, K):
    char = S[K-1]

    ans = ''
    for i in xrange(len(S)):
        ans += S[i] if S[i] == char else '*'
    return ans

if __name__ == '__main__':

    N = sys.stdin.readline().strip()
    S = sys.stdin.readline().strip()
    K = sys.stdin.readline().strip()
    ans = solve(int(N), S, int(K))
    print ans

Submission status: Accepted

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

ss = ''

for a in s:
 if a == s[k-1]:
  ss += s[k-1]
 else:
  ss += '*'
else:
 print(ss)

Submission status: Accepted

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


# Parse and assignment for input
n = int(input())
s = input()
k = int(input())
x = s[k-1]

ans = ""
for i in s :
    if i == x :
        ans += i
    else:
        ans += '*'
print(ans)

Submission status: Accepted

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

c = s[k-1]

def rep(x):
    if x == c:
        return c
    else:
        return "*"


ret = [rep(i) for i in s]

print(''.join(ret))

Submission status: Accepted

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

N = input()

S = input()

K = input()

ans = '';

for k,v in enumerate(S):
    
    
    if v == S[int(K)-1]:
        ans += v
    else:
        ans += '*' 

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
S=input()
K=int(input())
n=0
s=list(S)
a=s[K-1]
while True:
    if s[n] is not a:
        s[n]='*'
    n=n+1
    if n==N:
        break
mojiretu=''.join(s)
print(mojiretu)

Submission status: Accepted

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

moji = s[k-1]
answer = ""
for c in s:
    if c == moji:
        answer += c
    else:
        answer += "*"

print(answer)

Submission status: Accepted

Solution code:
a = int(input())
b = input()
c = int(input())
for i in range(len(b)):
    if b[i] != b[c-1]:
        b = b.replace(b[i],'*')
print(b)

Submission status: Accepted

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

l = list(S)

a = l[K-1]

ls = []

for i in l:
    if i == a:
        ls += i
    else:
        ls += '*'

ret = ''.join(ls)

print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import re

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

keychar = s[k-1]
mask = "*"
mask2 = "1"

masked = re.sub(r'%s'%keychar, mask2, s)
masked = re.sub(r'[a-z]', mask, masked)
masked = re.sub(r'%s'%mask2, keychar, masked)
print(masked)

Submission status: Accepted

Solution code:
i = [input() for i in range(3)]
#print(i)
l = []
count = 0
for n in i:
    if count != 1:
        n = int(n)
    l.append(n) 
    count += 1
#print(l)
s = l[1]
#print(type(s[l[2]]))

for i in range(l[0]):
    
    if s[i] != s[l[2]-1]:
        s = list(s)
        s[i] = '*'
        s = "".join(s)
        #s = s[:i+1] + '*' + s[i+2:]
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
str = input()
remained_str = str[ int(input()) - 1 ]

ans = ''
for s in str:
  if( s == remained_str ):
    ans += s
  else:
    ans += '*'
print(ans)

Submission status: Accepted

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

ans=''
for x in s:
    if x!=s[k-1]:
        ans=ans+'*'
    else:
        ans=ans+s[k-1]
print(ans)

Submission status: Accepted

Solution code:
import sys


def main():
    N = int(sys.stdin.readline())
    S = sys.stdin.readline().strip()
    K = int(sys.stdin.readline())
    s = S[K-1]
    result = ""
    for i in list(S):
        if i == s:
            result = result + i
        else:
            result = result + "*"
    print(result)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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] :
        del s[i]
        s.insert(i,"*")
        
x=''.join(s)
        
print(x)

Submission status: Accepted

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

import sys
input = sys.stdin.readline

def io_generator():
	return input()

#+++++++++++++++++++
	
def main(io):
	n=int(io())
	s=io()[:n]
	k=int(io())
	cc=s[k-1]
	ll=lambda c:c if c==cc else '*'

	return ''.join([ll(c) for c in list(s)])

#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

Submission status: Accepted

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

K_new = K - 1
i = 0

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

Submission status: Accepted

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

tgt=S[K-1:K]

out = ""
for i in range(N):
  c=S[i]
  if c==tgt: 
    out=out+c
  else:
    out=out+'*'

print out

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
s=input()
k=int(input())
l=list(s)
l_a=['*' if not l[k-1] in s else l[k-1] for s in l]
l_aa="".join(l_a)
print(l_aa)

Submission status: Accepted

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

Submission status: Accepted

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

str_list = list(s)
x = str_list[k-1]
for i in range(len(s)):
    if str_list[i] != x:
        str_list[i] = "*"
str_changed = "".join(str_list)
print(str_changed)

Submission status: Accepted

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

target = S[K-1]

index =[]

for i in range(0,N):
   if S[i] != target:
       index.append(i)

for j in range(0,len(index)):
   S = S[:index[j]] + '*' + S[index[j] + 1:]

print(S)

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())
K = S[K-1]
S = list(S)

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

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

Submission status: Accepted

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

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

token=s[k-1]

print("".join(["*" if w!=token else w for w in s]))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
word = input()
word_list=[]
word_num = int(input())

for i in range(len(word)):
    word_list.append(word[i])
    if str(word[i]) != str(word[word_num -1]):
         word_list[i] = '*'

print("".join(list(map(str,word_list))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


alphabet = S[int(K)-1]
answer = ''
for n in range(int(N)):
    if S[n] == alphabet:
        answer = answer+S[n]
    else:
        answer = answer+'*'

print(answer)

Submission status: Accepted

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

target = S[K]
for i in S:
    if not target == i:
        S = S.replace(S[inc], '*')
    inc += 1
print(S)

Submission status: Accepted

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

SK = str(S[K-1])
for i in range(0,N):
    if S[i] == SK:
        pass
    else:
        S[i] = '*'
for j in S:
  print(j, end ="")

Submission status: Accepted

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

Submission status: Accepted

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

word = S[K-1]

modify = ''
for s in S:
 if s == word:
   modify += s
 else:
   modify += '*'

print(modify)

Submission status: Accepted

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


s = list(sstr)

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


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

Submission status: Accepted

Solution code:
n = int(input())
s = input()
k = int(input())
t = [''] * n

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

print(''.join(t))

Submission status: Accepted

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

Submission status: Accepted

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

ok_str = S[K-1]

for i in range(N):
    if S[i] == ok_str:
        pass
    else:
        S[i] = '*' 

print(''.join(S))

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

trig = s[k-1]

out = ""

for l in s:
    if l == trig:
        out += trig
    else:
        out += "*"

print(out)

Submission status: Accepted

Solution code:
a = int(input())
strings = input()
num = int(input())
target = strings[num - 1]
for i in range(a):
    if target != strings[i]:
        strings = strings[:i] + "*" + strings[i + 1:]
print(strings)

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

Submission status: Accepted

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

c = S[K - 1]

ans = ''
for i, s in enumerate(S):
    if s == c:
        ans += s
    else:
        ans += '*'

print(ans)

Submission status: Accepted

Solution code:
a = int(input())
b = input()
c = int(input())
d = b[c-1]
for i in range(a):
    if b[i]!=d :
        b = b.replace(b[i],'*')
print(b)

Submission status: Accepted

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

# @date Time-stamp: <2019-04-20 21:58:06 tagashira>
# @file a.cpp
# @brief https://tenka1-2019-beginner.contest.atcoder.jp/tasks/tenka1_2019_b

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

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

output= ""
for char in S:
  if char != replace_char:
    output +="*"
  else:
    output +=char

print(output)

Submission status: Accepted

Solution code:
n = input()
s = input()
k = input()
n = int(n)
k = int(k)
a = str(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())
O = ["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"]
if S.islower():
    if len(S) == N:
        if 1 <= K <= N <= 10:
            W = str(S[K - 1])
            O.remove(W)
            for i in range(24):
                S = S.replace(O[i],"*")
print(S)

Submission status: Accepted

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

Submission status: Accepted

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

replace = s[k-1]
list_2 = list(s)

for i in range(len(s)):
    if list_2[i] != replace:
        list_2[i] = "*"
    
s = "".join(list_2)
print(s)

Submission status: Accepted

Solution code:
import sys
def p(*a):
  s=" ".join(map(str,a))
  #print(s)
  sys.stderr.write(s+"\n")


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

c=S[K-1]

ans=""
# 1文字ずつ処理
s = "abcdefghijklmnopqrstuvwxyz"
for a in S:
	if a==c:
		ans = ans + a
	else:
		ans = ans + '*'

print(ans)

Submission status: Accepted

Solution code:
import sys

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

SS = []

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

Submission status: Accepted

Solution code:
import re
n = input()
s = input()
k = input()
chlist = list(s)
ked = int(k) - 1
nonreplace = chlist[int(ked)]
for num in range(int(n)):
  #numed = num - 1
  if chlist[num] == nonreplace:
    pass
  else:
    chlist[num] = "*"
stred = ''.join(chlist)
print(stred)

Submission status: Accepted

Solution code:
N=int(input())
S=input()
K=int(input())-1
k=S[K]
h=[]
for i in range(N):
    g=S[i]
    if k==g:
        h.append(k)
    else:
        h.append("*")
m=','.join(h)
j=m.maketrans({',':''})
print(m.translate(j))

Submission status: Accepted

Solution code:
kazu = int(input())#文字数
mozi = input()#文字
sitei = int(input())#取り出す文字
lst = []
#print(mozi[sitei])
for i in range(kazu):
    if mozi[i] == mozi[sitei-1]:
        print(mozi[i],end ="")
    else:
        print("*",end="")

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(S)):
    if S[i] != st:
        S[i] = "*"

print(''.join(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
str = input()
str =list(str)
str.append("a")
cs = int(input())

char = str[cs-1]
for i in range(n):
  if str[i] != char:
    str[i:i+1] = "*"
ans = str[0:n]

print(*ans,sep ="")

Submission status: Accepted

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

ss = s[k-1]

new_s = []

for i in range(n):
    if s[i] != ss:
        new_s.append('*')
    else:
        new_s.append(ss)

print(''.join(new_s))

Submission status: Accepted

Solution code:
N = int(input())
S = list(input())
K = int(input())
char = S[K-1]
n = 0
for N in S:
    if S[n] != char:
        S[n] = '*'
        n += 1
    else:
        n +=1
        
S_ = ''.join(S)
print(S_)

Submission status: Accepted

Solution code:

N = int(input())
s = input()
K = int(input())
letter = s[K-1]
for i in range(N):
    if s[i] != letter:
        s = s[:i] + '*' + s[i+1:]
        
print(s)

Submission status: Accepted

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

tar = S[K-1]

lis = (_ if _==tar else "*" for _ in S)
print("".join(lis))

Submission status: Accepted

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

for l in s:
  if l != s[k-1]:
    l = "*"
  ans += l
print(ans)

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

Solution code:
n = input()
word = input()
a= input()
b=0
text=''
x=word[int(a)-1]
 
for i in range(int(n)):
    if word[i] == x:
         text = text + x
    else:
        text = text + '*'
print(text)

Submission status: Accepted

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

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

for i,char in enumerate(S):
  if char != Sk:
    a.append(str('*'))
  else:
    a.append(char)

print(''.join(a))