program CODE_FESTIVAL2016qBB
    implicit none
    integer(8)::N,A,B,count_B,i,flg,pass
    character(100000)::S
    read*,N,A,B,S
    count_B=0
    pass=0
    do i=1,N
        flg=0
        if(S(i:i)=="a")then
            if(pass<A+B)then
                flg=1
                pass=pass+1
            end if
        end if
        if(S(i:i)=="b")then
            count_B=count_B+1
            if(pass<A+B.and.count_B<=B)then
                flg=1
                pass=pass+1
            end if
        end if

        if(flg==0)print'(A)',"No"
        if(flg==1)print'(A)',"Yes"
    end do
end program CODE_FESTIVAL2016qBB
; 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"

@_QFEs = internal global [100000 x i8] undef
@_QQcl.c0930cde84441d83d0fdb628542c20d1 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_7836/source.f\00"
@_QQcl.61 = linkonce constant [1 x i8] c"a"
@_QQcl.62 = linkonce constant [1 x i8] c"b"
@_QQcl.284129 = linkonce constant [3 x i8] c"(A)"
@_QQcl.4E6F = linkonce constant [2 x i8] c"No"
@_QQcl.596573 = linkonce constant [3 x i8] c"Yes"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.c0930cde84441d83d0fdb628542c20d1, i32 5)
  %5 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %3, i32 8)
  %6 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %1, i32 8)
  %7 = call i1 @_FortranAioInputInteger(ptr %4, ptr nonnull %2, i32 8)
  %8 = call i1 @_FortranAioInputAscii(ptr %4, ptr nonnull @_QFEs, i64 100000)
  %9 = call i32 @_FortranAioEndIoStatement(ptr %4)
  %10 = load i64, ptr %3, align 8, !tbaa !3
  %11 = icmp sgt i64 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %0, %40
  %12 = phi i64 [ %42, %40 ], [ 1, %0 ]
  %.029 = phi i64 [ %.226, %40 ], [ 0, %0 ]
  %.01328 = phi i64 [ %.11424, %40 ], [ 0, %0 ]
  %13 = add nsw i64 %12, -1
  %14 = getelementptr [100000 x [1 x i8]], ptr @_QFEs, i64 0, i64 %13
  %15 = call i32 @_FortranACharacterCompareScalar1(ptr %14, ptr nonnull @_QQcl.61, i64 1, i64 1)
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %22

17:                                               ; preds = %.lr.ph
  %18 = load i64, ptr %1, align 8, !tbaa !3
  %19 = load i64, ptr %2, align 8, !tbaa !3
  %20 = add i64 %19, %18
  %21 = icmp slt i64 %.029, %20
  %spec.select = zext i1 %21 to i64
  %spec.select17 = add i64 %.029, %spec.select
  br label %22

22:                                               ; preds = %17, %.lr.ph
  %.011 = phi i64 [ 0, %.lr.ph ], [ %spec.select, %17 ]
  %.1 = phi i64 [ %.029, %.lr.ph ], [ %spec.select17, %17 ]
  %23 = call i32 @_FortranACharacterCompareScalar1(ptr %14, ptr nonnull @_QQcl.62, i64 1, i64 1)
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %34

25:                                               ; preds = %22
  %26 = add i64 %.01328, 1
  %27 = load i64, ptr %1, align 8, !tbaa !3
  %28 = load i64, ptr %2, align 8, !tbaa !3
  %29 = add i64 %28, %27
  %30 = icmp slt i64 %.1, %29
  %31 = icmp sle i64 %26, %28
  %32 = and i1 %31, %30
  %33 = add i64 %.1, 1
  br i1 %32, label %.thread, label %34

34:                                               ; preds = %25, %22
  %.114 = phi i64 [ %.01328, %22 ], [ %26, %25 ]
  %switch.not.not = icmp eq i64 %.011, 0
  br i1 %switch.not.not, label %35, label %.thread

35:                                               ; preds = %34
  %36 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.284129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.c0930cde84441d83d0fdb628542c20d1, i32 24)
  %37 = call i1 @_FortranAioOutputAscii(ptr %36, ptr nonnull @_QQcl.4E6F, i64 2)
  br label %40

.thread:                                          ; preds = %34, %25
  %.225 = phi i64 [ %.1, %34 ], [ %33, %25 ]
  %.11423 = phi i64 [ %.114, %34 ], [ %26, %25 ]
  %38 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.284129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.c0930cde84441d83d0fdb628542c20d1, i32 25)
  %39 = call i1 @_FortranAioOutputAscii(ptr %38, ptr nonnull @_QQcl.596573, i64 3)
  br label %40

40:                                               ; preds = %35, %.thread
  %.sink = phi ptr [ %36, %35 ], [ %38, %.thread ]
  %.226 = phi i64 [ %.1, %35 ], [ %.225, %.thread ]
  %.11424 = phi i64 [ %.114, %35 ], [ %.11423, %.thread ]
  %41 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  %42 = add nuw i64 %12, 1
  %exitcond.not = icmp eq i64 %12, %10
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %40, %0
  ret void
}

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

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

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

declare i32 @_FortranAioEndIoStatement(ptr) 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"}
