program main
  implicit none
  integer :: i, n, k
  character(10) :: s
  character(1) :: tar

  read *, n
  read *, s
  read *, k
  tar = s(k:k)

  do i = 1, n
    if (s(i:i) /= tar) then
      s(i:i) = '*'
    end if
  end do

  print '(a)', s

end program
; ModuleID = 'FIRModule'
source_filename = "FIRModule"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

@_QQcl.782c44104f14069a7f2438cbedd14953 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4429/source.f\00"
@_QQcl.2A = linkonce local_unnamed_addr constant [1 x i8] c"*"
@_QQcl.286129 = linkonce constant [3 x i8] c"(a)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [10 x i8], align 1
  %4 = alloca [1 x i8], align 1
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.782c44104f14069a7f2438cbedd14953, i32 7)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %2, i32 4)
  %7 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %8 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.782c44104f14069a7f2438cbedd14953, i32 8)
  %9 = call i1 @_FortranAioInputAscii(ptr %8, ptr nonnull %3, i64 10)
  %10 = call i32 @_FortranAioEndIoStatement(ptr %8)
  %11 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.782c44104f14069a7f2438cbedd14953, i32 9)
  %12 = call i1 @_FortranAioInputInteger(ptr %11, ptr nonnull %1, i32 4)
  %13 = call i32 @_FortranAioEndIoStatement(ptr %11)
  %14 = load i32, ptr %1, align 4, !tbaa !3
  %15 = sext i32 %14 to i64
  %16 = add nsw i64 %15, -1
  %17 = getelementptr [10 x [1 x i8]], ptr %3, i64 0, i64 %16
  %18 = load i8, ptr %17, align 1
  store i8 %18, ptr %4, align 1
  %19 = load i32, ptr %2, align 4, !tbaa !3
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0
  %21 = zext i32 %19 to i64
  %22 = load i8, ptr @_QQcl.2A, align 1
  br label %23

23:                                               ; preds = %.lr.ph, %28
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %28 ]
  %24 = add nsw i64 %indvars.iv, -1
  %25 = getelementptr [10 x [1 x i8]], ptr %3, i64 0, i64 %24
  %26 = call i32 @_FortranACharacterCompareScalar1(ptr %25, ptr nonnull %4, i64 1, i64 1)
  %.not = icmp eq i32 %26, 0
  br i1 %.not, label %28, label %27

27:                                               ; preds = %23
  store i8 %22, ptr %25, align 1
  br label %28

28:                                               ; preds = %27, %23
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv, %21
  br i1 %exitcond.not, label %._crit_edge, label %23

._crit_edge:                                      ; preds = %28, %0
  %29 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.782c44104f14069a7f2438cbedd14953, i32 18)
  %30 = call i1 @_FortranAioOutputAscii(ptr %29, ptr nonnull %3, i64 10)
  %31 = call i32 @_FortranAioEndIoStatement(ptr %29)
  ret void
}

declare ptr @_FortranAioBeginExternalListInput(i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioInputInteger(ptr, ptr, i32) local_unnamed_addr

declare i32 @_FortranAioEndIoStatement(ptr) local_unnamed_addr

declare i1 @_FortranAioInputAscii(ptr, ptr, i64) local_unnamed_addr

declare i32 @_FortranACharacterCompareScalar1(ptr, ptr, i64, i64) local_unnamed_addr

declare ptr @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

declare i1 @_FortranAioOutputAscii(ptr, ptr, i64) local_unnamed_addr

!llvm.module.flags = !{!0, !1, !2}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{!4, !4, i64 0}
!4 = !{!"any data access", !5, i64 0}
!5 = !{!"any access", !6, i64 0}
!6 = !{!"Flang Type TBAA Root"}
