program main
    implicit none
    INTEGER(8) n,a(3),i,x(2),x2(2),ans(100000),flag,j
    CHARACTER s1*2,s2*2
    read(*,*) n,(a(i),i=1,3)
    flag=1
!0が二つ含まれる/A+B+C=2の場合
    if ( ((a(1)==0 .and. a(2)==0) .or. (a(2)==0 .and. a(3)==0) .or. (a(3)==0 .and. a(1)==0)) .and. a(1)+a(2)+a(3)/=2 ) then
        do i = 1,n
            call read_s(s1,x)
            if ( a(x(1))+a(x(2))==0 ) then
                write(*,*) "No"
                flag=0
                do j = i+1, n
                    read(*,*) s1
                end do
                exit
            else
                call nomal(a,ans,x,i)
            end if
        end do
    else if ( ((a(1)==0 .and. a(2)==0) .or. (a(2)==0 .and. a(3)==0) .or. (a(3)==0 .and. a(1)==0)) .and. a(1)+a(2)+a(3)==2 ) then
        do i = 1,n
            if ( i==1 ) then
               call read_s(s1,x) 
            end if
            if ( a(x(1))+a(x(2))==0 ) then
                write(*,*) "No"
                flag=0
                do j = i+1, n
                    read(*,*) s1
                end do
                exit
            else
                if ( i<n ) then
                    call read_s(s2,x2)
                end if
                call exceptional(a,ans,x,x2,i)
                x=x2
            end if
        end do
!A+B+C=2の場合
    else if ( a(1)+a(2)+a(3)==2 ) then
        call read_s(s1,x)
        do i = 1, n
            if ( i<n ) then
                call read_s(s2,x2)
            end if
            call exceptional(a,ans,x,x2,i)
            x=x2
        end do
!それ以外
    else
        do i = 1, n
            call read_s(s1,x)
            call nomal(a,ans,x,i)
        end do
    end if
!答え出力
    if ( flag==1 ) then
        write(*,*) "Yes"
        do i = 1, n
            if(ans(i)==1) then
                write(*,*) "A"
            else if ( ans(i)==2 ) then
                write(*,*) "B"
            else
                write(*,*) "C"
            end if
        end do
    end if
contains
    subroutine read_s(sr, xr)
        implicit none
        INTEGER(8),INTENT(OUT):: xr(2)
        CHARACTER(*) sr
        read(*,*) sr
        if ( sr=="AB" ) then
            xr(1)=1
            xr(2)=2
        else if ( sr=="BC" ) then
            xr(1)=2
            xr(2)=3
        else 
            xr(1)=3
            xr(2)=1
        end if
    end subroutine read_s

    subroutine nomal(an, ansn, xn,in)
        implicit none
        INTEGER(8) an(3),xn(2),ansn(100000),in
        if ( an(xn(1))>=an(xn(2)) ) then
            an(xn(1))=an(xn(1))-1
            an(xn(2))=an(xn(2))+1
            ansn(in)=xn(2)
        else
            an(xn(1))=an(xn(1))+1
            an(xn(2))=an(xn(2))-1
            ansn(in)=xn(1)
        end if
    end subroutine nomal

    subroutine exceptional(ae, anse, xe, x2e,ie)
        implicit none
        INTEGER(8) ae(3),xe(2),x2e(2),anse(100000),ie
        if ( ae(xe(1))>ae(xe(2)) ) then
            ae(xe(1))=ae(xe(1))-1
            ae(xe(2))=ae(xe(2))+1
            anse(ie)=xe(2)
        else if ( a(x(1))<a(x(2)) ) then
            ae(xe(1))=ae(xe(1))+1
            ae(xe(2))=ae(xe(2))-1
            anse(ie)=xe(1)           
        else if ( xe(1)==x2e(1) .or. xe(1)==x2e(2) ) then
            ae(xe(1))=ae(xe(1))+1
            ae(xe(2))=ae(xe(2))-1
            anse(ie)=xe(1) 
        else
            ae(xe(1))=ae(xe(1))-1
            ae(xe(2))=ae(xe(2))+1
            anse(ie)=xe(2)
        end if
    end subroutine exceptional
end program main

; 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"

@_QFEans = internal unnamed_addr global [100000 x i64] undef
@_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_1540/source.f\00"
@_QQcl.4E6F = linkonce constant [2 x i8] c"No"
@_QQcl.596573 = linkonce constant [3 x i8] c"Yes"
@_QQcl.41 = linkonce constant [1 x i8] c"A"
@_QQcl.42 = linkonce constant [1 x i8] c"B"
@_QQcl.43 = linkonce constant [1 x i8] c"C"
@_QQcl.4142 = linkonce constant [2 x i8] c"AB"
@_QQcl.4243 = linkonce constant [2 x i8] c"BC"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

define void @_QQmain() local_unnamed_addr {
  %1 = alloca [3 x i64], align 8
  %2 = alloca i64, align 8
  %3 = alloca [2 x i8], align 1
  %4 = alloca [2 x i8], align 1
  %.sroa.0209 = alloca i64, align 8
  %.sroa.26 = alloca i64, align 8
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 5)
  %6 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %2, i32 8)
  %7 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %1, i32 8)
  %8 = getelementptr inbounds [3 x i64], ptr %1, i64 0, i64 1
  %9 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %8, i32 8)
  %10 = getelementptr inbounds [3 x i64], ptr %1, i64 0, i64 2
  %11 = call i1 @_FortranAioInputInteger(ptr %5, ptr nonnull %10, i32 8)
  %12 = call i32 @_FortranAioEndIoStatement(ptr %5)
  %13 = load i64, ptr %1, align 8, !tbaa !3
  %14 = load i64, ptr %8, align 8, !tbaa !3
  %15 = or i64 %14, %13
  %16 = icmp eq i64 %15, 0
  %17 = load i64, ptr %10, align 8, !tbaa !3
  %18 = or i64 %17, %14
  %19 = icmp eq i64 %18, 0
  %20 = or i1 %16, %19
  %21 = or i64 %17, %13
  %22 = icmp eq i64 %21, 0
  %23 = or i1 %22, %20
  %24 = add i64 %14, %13
  %25 = add i64 %24, %17
  %26 = icmp ne i64 %25, 2
  %27 = and i1 %26, %23
  br i1 %27, label %28, label %70

28:                                               ; preds = %0
  %29 = load i64, ptr %2, align 8, !tbaa !3
  %30 = icmp sgt i64 %29, 0
  br i1 %30, label %.lr.ph174, label %.critedge

.lr.ph174:                                        ; preds = %28, %62
  %storemerge118172 = phi i64 [ %69, %62 ], [ 1, %28 ]
  %31 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 77)
  %32 = call i1 @_FortranAioInputAscii(ptr %31, ptr nonnull %3, i64 2)
  %33 = call i32 @_FortranAioEndIoStatement(ptr %31)
  %34 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %3, ptr nonnull @_QQcl.4142, i64 2, i64 2)
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %_QFPread_s.exit, label %36

36:                                               ; preds = %.lr.ph174
  %37 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %3, ptr nonnull @_QQcl.4243, i64 2, i64 2)
  %38 = icmp eq i32 %37, 0
  %. = select i1 %38, i64 3, i64 1
  %.181 = select i1 %38, i64 2, i64 3
  br label %_QFPread_s.exit

_QFPread_s.exit:                                  ; preds = %36, %.lr.ph174
  %39 = phi i64 [ 2, %.lr.ph174 ], [ %., %36 ]
  %40 = phi i64 [ 1, %.lr.ph174 ], [ %.181, %36 ]
  %41 = add nsw i64 %40, -1
  %42 = getelementptr [3 x i64], ptr %1, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !3
  %44 = add nsw i64 %39, -1
  %45 = getelementptr [3 x i64], ptr %1, i64 0, i64 %44
  %46 = load i64, ptr %45, align 8, !tbaa !3
  %47 = sub i64 0, %46
  %48 = icmp eq i64 %43, %47
  br i1 %48, label %49, label %62

49:                                               ; preds = %_QFPread_s.exit
  %50 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 12)
  %51 = call i1 @_FortranAioOutputAscii(ptr %50, ptr nonnull @_QQcl.4E6F, i64 2)
  %52 = call i32 @_FortranAioEndIoStatement(ptr %50)
  %53 = load i64, ptr %2, align 8, !tbaa !3
  %54 = sub i64 %53, %storemerge118172
  %55 = icmp sgt i64 %54, 0
  br i1 %55, label %.lr.ph180, label %.loopexit

.lr.ph180:                                        ; preds = %49, %.lr.ph180
  %56 = phi i64 [ %60, %.lr.ph180 ], [ %54, %49 ]
  %57 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 15)
  %58 = call i1 @_FortranAioInputAscii(ptr %57, ptr nonnull %3, i64 2)
  %59 = call i32 @_FortranAioEndIoStatement(ptr %57)
  %60 = add nsw i64 %56, -1
  %61 = icmp ugt i64 %56, 1
  br i1 %61, label %.lr.ph180, label %.loopexit

62:                                               ; preds = %_QFPread_s.exit
  %.not.i = icmp slt i64 %43, %46
  %..i = select i1 %.not.i, i64 1, i64 -1
  %.10.i = select i1 %.not.i, i64 -1, i64 1
  %63 = add i64 %..i, %43
  store i64 %63, ptr %42, align 8, !tbaa !3
  %64 = load i64, ptr %45, align 8, !tbaa !3
  %65 = add i64 %64, %.10.i
  store i64 %65, ptr %45, align 8, !tbaa !3
  %66 = select i1 %.not.i, i64 %40, i64 %39
  %67 = add nsw i64 %storemerge118172, -1
  %68 = getelementptr [100000 x i64], ptr @_QFEans, i64 0, i64 %67
  store i64 %66, ptr %68, align 8, !tbaa !3
  %69 = add nuw i64 %storemerge118172, 1
  %exitcond200.not = icmp eq i64 %storemerge118172, %29
  br i1 %exitcond200.not, label %.critedge, label %.lr.ph174

70:                                               ; preds = %0
  %71 = icmp eq i64 %25, 2
  %72 = and i1 %71, %23
  br i1 %72, label %73, label %172

73:                                               ; preds = %70
  %74 = load i64, ptr %2, align 8, !tbaa !3
  %75 = icmp sgt i64 %74, 0
  br i1 %75, label %.lr.ph166, label %.critedge

.lr.ph166:                                        ; preds = %73
  %76 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 77)
  %77 = call i1 @_FortranAioInputAscii(ptr %76, ptr nonnull %3, i64 2)
  %78 = call i32 @_FortranAioEndIoStatement(ptr %76)
  %79 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %3, ptr nonnull @_QQcl.4142, i64 2, i64 2)
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %86, label %81

81:                                               ; preds = %.lr.ph166
  %82 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %3, ptr nonnull @_QQcl.4243, i64 2, i64 2)
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %85, label %84

84:                                               ; preds = %81
  store i64 3, ptr %.sroa.0209, align 8, !tbaa !3
  store i64 1, ptr %.sroa.26, align 8, !tbaa !3
  br label %_QFPread_s.exit119.peel

85:                                               ; preds = %81
  store i64 2, ptr %.sroa.0209, align 8, !tbaa !3
  store i64 3, ptr %.sroa.26, align 8, !tbaa !3
  br label %_QFPread_s.exit119.peel

86:                                               ; preds = %.lr.ph166
  store i64 1, ptr %.sroa.0209, align 8, !tbaa !3
  store i64 2, ptr %.sroa.26, align 8, !tbaa !3
  br label %_QFPread_s.exit119.peel

_QFPread_s.exit119.peel:                          ; preds = %86, %85, %84
  %.sroa.26.0..sroa.26.8.212 = phi i64 [ 1, %86 ], [ 2, %85 ], [ 0, %84 ]
  %.sroa.0209.0..sroa.0209.0.211 = phi i64 [ 1, %86 ], [ 2, %85 ], [ 3, %84 ]
  %87 = add nsw i64 %.sroa.0209.0..sroa.0209.0.211, -1
  %88 = getelementptr [3 x i64], ptr %1, i64 0, i64 %87
  %89 = load i64, ptr %88, align 8, !tbaa !3
  %90 = getelementptr [3 x i64], ptr %1, i64 0, i64 %.sroa.26.0..sroa.26.8.212
  %91 = load i64, ptr %90, align 8, !tbaa !3
  %92 = sub i64 0, %91
  %93 = icmp eq i64 %89, %92
  br i1 %93, label %.loopexit199, label %94

94:                                               ; preds = %_QFPread_s.exit119.peel
  %95 = load i64, ptr %2, align 8, !tbaa !3
  %96 = icmp sgt i64 %95, 1
  br i1 %96, label %97, label %_QFPread_s.exit120.peel

97:                                               ; preds = %94
  %98 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 77)
  %99 = call i1 @_FortranAioInputAscii(ptr %98, ptr nonnull %4, i64 2)
  %100 = call i32 @_FortranAioEndIoStatement(ptr %98)
  %101 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %4, ptr nonnull @_QQcl.4142, i64 2, i64 2)
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %_QFPread_s.exit120.peel, label %103

103:                                              ; preds = %97
  %104 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %4, ptr nonnull @_QQcl.4243, i64 2, i64 2)
  %105 = icmp eq i32 %104, 0
  %spec.select = select i1 %105, i64 3, i64 1
  %spec.select227 = select i1 %105, i64 2, i64 3
  br label %_QFPread_s.exit120.peel

_QFPread_s.exit120.peel:                          ; preds = %103, %97, %94
  %.sroa.14.0 = phi i64 [ undef, %94 ], [ 2, %97 ], [ %spec.select, %103 ]
  %.sroa.0.0 = phi i64 [ undef, %94 ], [ 1, %97 ], [ %spec.select227, %103 ]
  %106 = load i64, ptr %88, align 8, !tbaa !3
  %107 = load i64, ptr %90, align 8, !tbaa !3
  %108 = icmp sgt i64 %106, %107
  br i1 %108, label %_QFPexceptional.exit.peel, label %109

109:                                              ; preds = %_QFPread_s.exit120.peel
  %110 = icmp slt i64 %106, %107
  br i1 %110, label %_QFPexceptional.exit.peel, label %111

111:                                              ; preds = %109
  %112 = icmp eq i64 %.sroa.0209.0..sroa.0209.0.211, %.sroa.0.0
  %113 = icmp eq i64 %.sroa.0209.0..sroa.0209.0.211, %.sroa.14.0
  %114 = or i1 %112, %113
  %..i121.peel = select i1 %114, i64 1, i64 -1
  %.71.i.peel = select i1 %114, i64 -1, i64 1
  %.72.i.peel = select i1 %114, ptr %.sroa.0209, ptr %.sroa.26
  br label %_QFPexceptional.exit.peel

_QFPexceptional.exit.peel:                        ; preds = %111, %109, %_QFPread_s.exit120.peel
  %.sink70.i.peel = phi i64 [ -1, %_QFPread_s.exit120.peel ], [ 1, %109 ], [ %..i121.peel, %111 ]
  %.sink68.i.peel = phi i64 [ 1, %_QFPread_s.exit120.peel ], [ -1, %109 ], [ %.71.i.peel, %111 ]
  %.sink65.i.peel = phi ptr [ %.sroa.26, %_QFPread_s.exit120.peel ], [ %.sroa.0209, %109 ], [ %.72.i.peel, %111 ]
  %115 = add i64 %.sink70.i.peel, %106
  store i64 %115, ptr %88, align 8, !tbaa !3
  %116 = load i64, ptr %90, align 8, !tbaa !3
  %117 = add i64 %116, %.sink68.i.peel
  store i64 %117, ptr %90, align 8, !tbaa !3
  %118 = load i64, ptr %.sink65.i.peel, align 8, !tbaa !3
  store i64 %118, ptr @_QFEans, align 16, !tbaa !3
  store i64 %.sroa.0.0, ptr %.sroa.0209, align 8, !tbaa !3
  store i64 %.sroa.14.0, ptr %.sroa.26, align 8, !tbaa !3
  %exitcond197.peel.not = icmp eq i64 %74, 1
  br i1 %exitcond197.peel.not, label %.critedge, label %_QFPread_s.exit119

_QFPread_s.exit119:                               ; preds = %_QFPexceptional.exit.peel, %_QFPexceptional.exit
  %.sroa.26.0..sroa.26.8. = phi i64 [ %.sroa.14.2, %_QFPexceptional.exit ], [ %.sroa.14.0, %_QFPexceptional.exit.peel ]
  %.sroa.0209.0..sroa.0209.0. = phi i64 [ %.sroa.0.2, %_QFPexceptional.exit ], [ %.sroa.0.0, %_QFPexceptional.exit.peel ]
  %119 = phi i64 [ %154, %_QFPexceptional.exit ], [ %.sroa.14.0, %_QFPexceptional.exit.peel ]
  %storemerge164 = phi i64 [ %171, %_QFPexceptional.exit ], [ 2, %_QFPexceptional.exit.peel ]
  %120 = phi i64 [ %155, %_QFPexceptional.exit ], [ %.sroa.0.0, %_QFPexceptional.exit.peel ]
  %121 = add i64 %.sroa.0209.0..sroa.0209.0., -1
  %122 = getelementptr [3 x i64], ptr %1, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !3
  %124 = add i64 %.sroa.26.0..sroa.26.8., -1
  %125 = getelementptr [3 x i64], ptr %1, i64 0, i64 %124
  %126 = load i64, ptr %125, align 8, !tbaa !3
  %127 = sub i64 0, %126
  %128 = icmp eq i64 %123, %127
  br i1 %128, label %.loopexit199, label %141

.loopexit199:                                     ; preds = %_QFPread_s.exit119, %_QFPread_s.exit119.peel
  %storemerge164.lcssa = phi i64 [ 1, %_QFPread_s.exit119.peel ], [ %storemerge164, %_QFPread_s.exit119 ]
  %129 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 28)
  %130 = call i1 @_FortranAioOutputAscii(ptr %129, ptr nonnull @_QQcl.4E6F, i64 2)
  %131 = call i32 @_FortranAioEndIoStatement(ptr %129)
  %132 = load i64, ptr %2, align 8, !tbaa !3
  %133 = sub i64 %132, %storemerge164.lcssa
  %134 = icmp sgt i64 %133, 0
  br i1 %134, label %.lr.ph168, label %.loopexit

.lr.ph168:                                        ; preds = %.loopexit199, %.lr.ph168
  %135 = phi i64 [ %139, %.lr.ph168 ], [ %133, %.loopexit199 ]
  %136 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 31)
  %137 = call i1 @_FortranAioInputAscii(ptr %136, ptr nonnull %3, i64 2)
  %138 = call i32 @_FortranAioEndIoStatement(ptr %136)
  %139 = add nsw i64 %135, -1
  %140 = icmp ugt i64 %135, 1
  br i1 %140, label %.lr.ph168, label %.loopexit

141:                                              ; preds = %_QFPread_s.exit119
  %142 = load i64, ptr %2, align 8, !tbaa !3
  %143 = icmp slt i64 %storemerge164, %142
  br i1 %143, label %144, label %_QFPread_s.exit120

144:                                              ; preds = %141
  %145 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 77)
  %146 = call i1 @_FortranAioInputAscii(ptr %145, ptr nonnull %4, i64 2)
  %147 = call i32 @_FortranAioEndIoStatement(ptr %145)
  %148 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %4, ptr nonnull @_QQcl.4142, i64 2, i64 2)
  %149 = icmp eq i32 %148, 0
  br i1 %149, label %_QFPread_s.exit120, label %150

150:                                              ; preds = %144
  %151 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %4, ptr nonnull @_QQcl.4243, i64 2, i64 2)
  %152 = icmp eq i32 %151, 0
  br i1 %152, label %_QFPread_s.exit120, label %153

153:                                              ; preds = %150
  br label %_QFPread_s.exit120

_QFPread_s.exit120:                               ; preds = %150, %144, %153, %141
  %.sroa.14.2 = phi i64 [ 1, %153 ], [ %.sroa.26.0..sroa.26.8., %141 ], [ 2, %144 ], [ 3, %150 ]
  %.sroa.0.2 = phi i64 [ 3, %153 ], [ %.sroa.0209.0..sroa.0209.0., %141 ], [ 1, %144 ], [ 2, %150 ]
  %154 = phi i64 [ 1, %153 ], [ %119, %141 ], [ 2, %144 ], [ 3, %150 ]
  %155 = phi i64 [ 3, %153 ], [ %120, %141 ], [ 1, %144 ], [ 2, %150 ]
  %156 = load i64, ptr %122, align 8, !tbaa !3
  %157 = load i64, ptr %125, align 8, !tbaa !3
  %158 = icmp sgt i64 %156, %157
  br i1 %158, label %_QFPexceptional.exit, label %159

159:                                              ; preds = %_QFPread_s.exit120
  %160 = icmp slt i64 %156, %157
  br i1 %160, label %_QFPexceptional.exit, label %161

161:                                              ; preds = %159
  %162 = icmp eq i64 %.sroa.0209.0..sroa.0209.0., %155
  %163 = icmp eq i64 %.sroa.0209.0..sroa.0209.0., %154
  %164 = or i1 %162, %163
  %..i121 = select i1 %164, i64 1, i64 -1
  %.71.i = select i1 %164, i64 -1, i64 1
  %.72.i = select i1 %164, ptr %.sroa.0209, ptr %.sroa.26
  br label %_QFPexceptional.exit

_QFPexceptional.exit:                             ; preds = %_QFPread_s.exit120, %159, %161
  %.sink70.i = phi i64 [ -1, %_QFPread_s.exit120 ], [ 1, %159 ], [ %..i121, %161 ]
  %.sink68.i = phi i64 [ 1, %_QFPread_s.exit120 ], [ -1, %159 ], [ %.71.i, %161 ]
  %.sink65.i = phi ptr [ %.sroa.26, %_QFPread_s.exit120 ], [ %.sroa.0209, %159 ], [ %.72.i, %161 ]
  %165 = add i64 %.sink70.i, %156
  store i64 %165, ptr %122, align 8, !tbaa !3
  %166 = load i64, ptr %125, align 8, !tbaa !3
  %167 = add i64 %166, %.sink68.i
  store i64 %167, ptr %125, align 8, !tbaa !3
  %168 = load i64, ptr %.sink65.i, align 8, !tbaa !3
  %169 = add i64 %storemerge164, -1
  %170 = getelementptr [100000 x i64], ptr @_QFEans, i64 0, i64 %169
  store i64 %168, ptr %170, align 8, !tbaa !3
  store i64 %.sroa.0.2, ptr %.sroa.0209, align 8, !tbaa !3
  store i64 %.sroa.14.2, ptr %.sroa.26, align 8, !tbaa !3
  %171 = add nuw i64 %storemerge164, 1
  %exitcond197.not = icmp eq i64 %storemerge164, %74
  br i1 %exitcond197.not, label %.critedge, label %_QFPread_s.exit119, !llvm.loop !7

172:                                              ; preds = %70
  br i1 %71, label %173, label %224

173:                                              ; preds = %172
  %174 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 77)
  %175 = call i1 @_FortranAioInputAscii(ptr %174, ptr nonnull %3, i64 2)
  %176 = call i32 @_FortranAioEndIoStatement(ptr %174)
  %177 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %3, ptr nonnull @_QQcl.4142, i64 2, i64 2)
  %178 = icmp eq i32 %177, 0
  br i1 %178, label %179, label %180

179:                                              ; preds = %173
  store i64 1, ptr %.sroa.0209, align 8, !tbaa !3
  store i64 2, ptr %.sroa.26, align 8, !tbaa !3
  br label %_QFPread_s.exit122

180:                                              ; preds = %173
  %181 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %3, ptr nonnull @_QQcl.4243, i64 2, i64 2)
  %182 = icmp eq i32 %181, 0
  br i1 %182, label %183, label %184

183:                                              ; preds = %180
  store i64 2, ptr %.sroa.0209, align 8, !tbaa !3
  store i64 3, ptr %.sroa.26, align 8, !tbaa !3
  br label %_QFPread_s.exit122

184:                                              ; preds = %180
  store i64 3, ptr %.sroa.0209, align 8, !tbaa !3
  store i64 1, ptr %.sroa.26, align 8, !tbaa !3
  br label %_QFPread_s.exit122

_QFPread_s.exit122:                               ; preds = %179, %183, %184
  %.sroa.26.0..sroa.26.8.213217 = phi i64 [ 2, %179 ], [ 3, %183 ], [ 1, %184 ]
  %.sroa.0209.0..sroa.0209.0.210215 = phi i64 [ 1, %179 ], [ 2, %183 ], [ 3, %184 ]
  %185 = load i64, ptr %2, align 8, !tbaa !3
  %186 = icmp sgt i64 %185, 0
  br i1 %186, label %.lr.ph161, label %.critedge

.lr.ph161:                                        ; preds = %_QFPread_s.exit122, %_QFPexceptional.exit132
  %.sroa.26.0..sroa.26.8.213 = phi i64 [ %.sroa.14.4, %_QFPexceptional.exit132 ], [ %.sroa.26.0..sroa.26.8.213217, %_QFPread_s.exit122 ]
  %.sroa.0209.0..sroa.0209.0.210 = phi i64 [ %.sroa.0.4, %_QFPexceptional.exit132 ], [ %.sroa.0209.0..sroa.0209.0.210215, %_QFPread_s.exit122 ]
  %.sroa.14.3 = phi i64 [ %.sroa.14.4, %_QFPexceptional.exit132 ], [ undef, %_QFPread_s.exit122 ]
  %.sroa.0.3 = phi i64 [ %.sroa.0.4, %_QFPexceptional.exit132 ], [ undef, %_QFPread_s.exit122 ]
  %187 = phi i64 [ %202, %_QFPexceptional.exit132 ], [ undef, %_QFPread_s.exit122 ]
  %188 = phi i64 [ %223, %_QFPexceptional.exit132 ], [ 1, %_QFPread_s.exit122 ]
  %189 = phi i64 [ %203, %_QFPexceptional.exit132 ], [ undef, %_QFPread_s.exit122 ]
  %190 = load i64, ptr %2, align 8, !tbaa !3
  %191 = icmp slt i64 %188, %190
  br i1 %191, label %192, label %_QFPread_s.exit123

192:                                              ; preds = %.lr.ph161
  %193 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 77)
  %194 = call i1 @_FortranAioInputAscii(ptr %193, ptr nonnull %4, i64 2)
  %195 = call i32 @_FortranAioEndIoStatement(ptr %193)
  %196 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %4, ptr nonnull @_QQcl.4142, i64 2, i64 2)
  %197 = icmp eq i32 %196, 0
  br i1 %197, label %_QFPread_s.exit123, label %198

198:                                              ; preds = %192
  %199 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %4, ptr nonnull @_QQcl.4243, i64 2, i64 2)
  %200 = icmp eq i32 %199, 0
  br i1 %200, label %_QFPread_s.exit123, label %201

201:                                              ; preds = %198
  br label %_QFPread_s.exit123

_QFPread_s.exit123:                               ; preds = %198, %192, %201, %.lr.ph161
  %.sroa.14.4 = phi i64 [ 1, %201 ], [ %.sroa.14.3, %.lr.ph161 ], [ 2, %192 ], [ 3, %198 ]
  %.sroa.0.4 = phi i64 [ 3, %201 ], [ %.sroa.0.3, %.lr.ph161 ], [ 1, %192 ], [ 2, %198 ]
  %202 = phi i64 [ 1, %201 ], [ %187, %.lr.ph161 ], [ 2, %192 ], [ 3, %198 ]
  %203 = phi i64 [ 3, %201 ], [ %189, %.lr.ph161 ], [ 1, %192 ], [ 2, %198 ]
  %204 = add i64 %.sroa.0209.0..sroa.0209.0.210, -1
  %205 = getelementptr [3 x i64], ptr %1, i64 0, i64 %204
  %206 = load i64, ptr %205, align 8, !tbaa !3
  %207 = add i64 %.sroa.26.0..sroa.26.8.213, -1
  %208 = getelementptr [3 x i64], ptr %1, i64 0, i64 %207
  %209 = load i64, ptr %208, align 8, !tbaa !3
  %210 = icmp sgt i64 %206, %209
  br i1 %210, label %_QFPexceptional.exit132, label %211

211:                                              ; preds = %_QFPread_s.exit123
  %212 = icmp slt i64 %206, %209
  br i1 %212, label %_QFPexceptional.exit132, label %213

213:                                              ; preds = %211
  %214 = icmp eq i64 %.sroa.0209.0..sroa.0209.0.210, %203
  %215 = icmp eq i64 %.sroa.0209.0..sroa.0209.0.210, %202
  %216 = or i1 %214, %215
  %..i126 = select i1 %216, i64 1, i64 -1
  %.71.i127 = select i1 %216, i64 -1, i64 1
  %.72.i128 = select i1 %216, ptr %.sroa.0209, ptr %.sroa.26
  br label %_QFPexceptional.exit132

_QFPexceptional.exit132:                          ; preds = %_QFPread_s.exit123, %211, %213
  %.sink70.i129 = phi i64 [ -1, %_QFPread_s.exit123 ], [ 1, %211 ], [ %..i126, %213 ]
  %.sink68.i130 = phi i64 [ 1, %_QFPread_s.exit123 ], [ -1, %211 ], [ %.71.i127, %213 ]
  %.sink65.i131 = phi ptr [ %.sroa.26, %_QFPread_s.exit123 ], [ %.sroa.0209, %211 ], [ %.72.i128, %213 ]
  %217 = add i64 %.sink70.i129, %206
  store i64 %217, ptr %205, align 8, !tbaa !3
  %218 = load i64, ptr %208, align 8, !tbaa !3
  %219 = add i64 %218, %.sink68.i130
  store i64 %219, ptr %208, align 8, !tbaa !3
  %220 = load i64, ptr %.sink65.i131, align 8, !tbaa !3
  %221 = add i64 %188, -1
  %222 = getelementptr [100000 x i64], ptr @_QFEans, i64 0, i64 %221
  store i64 %220, ptr %222, align 8, !tbaa !3
  store i64 %.sroa.0.4, ptr %.sroa.0209, align 8, !tbaa !3
  store i64 %.sroa.14.4, ptr %.sroa.26, align 8, !tbaa !3
  %223 = add nuw i64 %188, 1
  %exitcond196.not = icmp eq i64 %188, %185
  br i1 %exitcond196.not, label %.critedge, label %.lr.ph161

224:                                              ; preds = %172
  %225 = load i64, ptr %2, align 8, !tbaa !3
  %226 = icmp sgt i64 %225, 0
  br i1 %226, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %224, %_QFPread_s.exit133
  %227 = phi i64 [ %250, %_QFPread_s.exit133 ], [ 1, %224 ]
  %228 = call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 77)
  %229 = call i1 @_FortranAioInputAscii(ptr %228, ptr nonnull %3, i64 2)
  %230 = call i32 @_FortranAioEndIoStatement(ptr %228)
  %231 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %3, ptr nonnull @_QQcl.4142, i64 2, i64 2)
  %232 = icmp eq i32 %231, 0
  br i1 %232, label %_QFPread_s.exit133, label %233

233:                                              ; preds = %.lr.ph
  %234 = call i32 @_FortranACharacterCompareScalar1(ptr nonnull %3, ptr nonnull @_QQcl.4243, i64 2, i64 2)
  %235 = icmp eq i32 %234, 0
  %.182 = select i1 %235, i64 3, i64 1
  %.183 = select i1 %235, i64 2, i64 3
  br label %_QFPread_s.exit133

_QFPread_s.exit133:                               ; preds = %233, %.lr.ph
  %236 = phi i64 [ 2, %.lr.ph ], [ %.182, %233 ]
  %237 = phi i64 [ 1, %.lr.ph ], [ %.183, %233 ]
  %238 = add nsw i64 %237, -1
  %239 = getelementptr [3 x i64], ptr %1, i64 0, i64 %238
  %240 = load i64, ptr %239, align 8, !tbaa !3
  %241 = add nsw i64 %236, -1
  %242 = getelementptr [3 x i64], ptr %1, i64 0, i64 %241
  %243 = load i64, ptr %242, align 8, !tbaa !3
  %.not.i134 = icmp slt i64 %240, %243
  %..i135 = select i1 %.not.i134, i64 1, i64 -1
  %.10.i136 = select i1 %.not.i134, i64 -1, i64 1
  %244 = add i64 %..i135, %240
  store i64 %244, ptr %239, align 8, !tbaa !3
  %245 = load i64, ptr %242, align 8, !tbaa !3
  %246 = add i64 %245, %.10.i136
  store i64 %246, ptr %242, align 8, !tbaa !3
  %247 = select i1 %.not.i134, i64 %237, i64 %236
  %248 = add nsw i64 %227, -1
  %249 = getelementptr [100000 x i64], ptr @_QFEans, i64 0, i64 %248
  store i64 %247, ptr %249, align 8, !tbaa !3
  %250 = add nuw i64 %227, 1
  %exitcond.not = icmp eq i64 %227, %225
  br i1 %exitcond.not, label %.critedge, label %.lr.ph

.critedge:                                        ; preds = %_QFPread_s.exit133, %_QFPexceptional.exit132, %_QFPexceptional.exit, %62, %224, %28, %_QFPexceptional.exit.peel, %_QFPread_s.exit122, %73
  %251 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 61)
  %252 = call i1 @_FortranAioOutputAscii(ptr %251, ptr nonnull @_QQcl.596573, i64 3)
  %253 = call i32 @_FortranAioEndIoStatement(ptr %251)
  %254 = load i64, ptr %2, align 8, !tbaa !3
  %255 = icmp sgt i64 %254, 0
  br i1 %255, label %.lr.ph179, label %.loopexit

.lr.ph179:                                        ; preds = %.critedge, %269
  %256 = phi i64 [ %271, %269 ], [ 1, %.critedge ]
  %257 = add nsw i64 %256, -1
  %258 = getelementptr [100000 x i64], ptr @_QFEans, i64 0, i64 %257
  %259 = load i64, ptr %258, align 8, !tbaa !3
  switch i64 %259, label %266 [
    i64 1, label %260
    i64 2, label %263
  ]

260:                                              ; preds = %.lr.ph179
  %261 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 64)
  %262 = call i1 @_FortranAioOutputAscii(ptr %261, ptr nonnull @_QQcl.41, i64 1)
  br label %269

263:                                              ; preds = %.lr.ph179
  %264 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 66)
  %265 = call i1 @_FortranAioOutputAscii(ptr %264, ptr nonnull @_QQcl.42, i64 1)
  br label %269

266:                                              ; preds = %.lr.ph179
  %267 = call ptr @_FortranAioBeginExternalListOutput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 68)
  %268 = call i1 @_FortranAioOutputAscii(ptr %267, ptr nonnull @_QQcl.43, i64 1)
  br label %269

269:                                              ; preds = %260, %263, %266
  %.sink = phi ptr [ %261, %260 ], [ %264, %263 ], [ %267, %266 ]
  %270 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  %271 = add nuw i64 %256, 1
  %exitcond201.not = icmp eq i64 %256, %254
  br i1 %exitcond201.not, label %.loopexit, label %.lr.ph179

.loopexit:                                        ; preds = %.lr.ph168, %269, %.lr.ph180, %.loopexit199, %.critedge, %49
  ret void
}

define void @_QFPread_s(ptr %0, ptr nocapture writeonly %1, ptr nest nocapture readnone %2, i64 %3) local_unnamed_addr {
  %5 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.76f3fb8e0627c0a1f1bd48dc14f84001, i32 77)
  %6 = tail call i1 @_FortranAioInputAscii(ptr %5, ptr %0, i64 %3)
  %7 = tail call i32 @_FortranAioEndIoStatement(ptr %5)
  %8 = tail call i32 @_FortranACharacterCompareScalar1(ptr %0, ptr nonnull @_QQcl.4142, i64 %3, i64 2)
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %10, label %12

10:                                               ; preds = %4
  store i64 1, ptr %1, align 8, !tbaa !3
  %11 = getelementptr [2 x i64], ptr %1, i64 0, i64 1
  store i64 2, ptr %11, align 8, !tbaa !3
  br label %18

12:                                               ; preds = %4
  %13 = tail call i32 @_FortranACharacterCompareScalar1(ptr %0, ptr nonnull @_QQcl.4243, i64 %3, i64 2)
  %14 = icmp eq i32 %13, 0
  %15 = getelementptr [2 x i64], ptr %1, i64 0, i64 1
  br i1 %14, label %16, label %17

16:                                               ; preds = %12
  store i64 2, ptr %1, align 8, !tbaa !3
  store i64 3, ptr %15, align 8, !tbaa !3
  br label %18

17:                                               ; preds = %12
  store i64 3, ptr %1, align 8, !tbaa !3
  store i64 1, ptr %15, align 8, !tbaa !3
  br label %18

18:                                               ; preds = %10, %16, %17
  ret void
}

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
define void @_QFPnomal(ptr nocapture %0, ptr nocapture writeonly %1, ptr nocapture readonly %2, ptr nocapture readonly %3, ptr nest nocapture readnone %4) local_unnamed_addr #0 {
  %6 = load i64, ptr %2, align 8, !tbaa !3
  %7 = add i64 %6, -1
  %8 = getelementptr [3 x i64], ptr %0, i64 0, i64 %7
  %9 = load i64, ptr %8, align 8, !tbaa !3
  %10 = getelementptr [2 x i64], ptr %2, i64 0, i64 1
  %11 = load i64, ptr %10, align 8, !tbaa !3
  %12 = add i64 %11, -1
  %13 = getelementptr [3 x i64], ptr %0, i64 0, i64 %12
  %14 = load i64, ptr %13, align 8, !tbaa !3
  %.not = icmp slt i64 %9, %14
  %. = select i1 %.not, i64 1, i64 -1
  %.10 = select i1 %.not, i64 -1, i64 1
  %15 = add i64 %9, %.
  store i64 %15, ptr %8, align 8, !tbaa !3
  %16 = load i64, ptr %10, align 8, !tbaa !3
  %17 = add i64 %16, -1
  %18 = getelementptr [3 x i64], ptr %0, i64 0, i64 %17
  %19 = load i64, ptr %18, align 8, !tbaa !3
  %20 = add i64 %19, %.10
  store i64 %20, ptr %18, align 8, !tbaa !3
  %.val = load i64, ptr %2, align 8
  %.val12 = load i64, ptr %10, align 8
  %21 = select i1 %.not, i64 %.val, i64 %.val12
  %22 = load i64, ptr %3, align 8, !tbaa !3
  %23 = add i64 %22, -1
  %24 = getelementptr [100000 x i64], ptr %1, i64 0, i64 %23
  store i64 %21, ptr %24, align 8, !tbaa !3
  ret void
}

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none)
define void @_QFPexceptional(ptr nocapture %0, ptr nocapture writeonly %1, ptr nocapture readonly %2, ptr nocapture readonly %3, ptr nocapture readonly %4, ptr nest nocapture readonly %5) local_unnamed_addr #1 {
  %7 = load i64, ptr %2, align 8, !tbaa !3
  %8 = add i64 %7, -1
  %9 = getelementptr [3 x i64], ptr %0, i64 0, i64 %8
  %10 = load i64, ptr %9, align 8, !tbaa !3
  %11 = getelementptr [2 x i64], ptr %2, i64 0, i64 1
  %12 = load i64, ptr %11, align 8, !tbaa !3
  %13 = add i64 %12, -1
  %14 = getelementptr [3 x i64], ptr %0, i64 0, i64 %13
  %15 = load i64, ptr %14, align 8, !tbaa !3
  %16 = icmp sgt i64 %10, %15
  br i1 %16, label %36, label %17

17:                                               ; preds = %6
  %18 = getelementptr { { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] }, { ptr, i64, i32, i8, i8, i8, i8, [1 x [3 x i64]] } }, ptr %5, i64 0, i32 1
  %.unpack41 = load ptr, ptr %18, align 8, !tbaa !9
  %.unpack = load ptr, ptr %5, align 8, !tbaa !9
  %19 = load i64, ptr %.unpack41, align 8, !tbaa !3
  %20 = add i64 %19, -1
  %21 = getelementptr [3 x i64], ptr %.unpack, i64 0, i64 %20
  %22 = load i64, ptr %21, align 8, !tbaa !3
  %23 = getelementptr [2 x i64], ptr %.unpack41, i64 0, i64 1
  %24 = load i64, ptr %23, align 8, !tbaa !3
  %25 = add i64 %24, -1
  %26 = getelementptr [3 x i64], ptr %.unpack, i64 0, i64 %25
  %27 = load i64, ptr %26, align 8, !tbaa !3
  %28 = icmp slt i64 %22, %27
  br i1 %28, label %36, label %29

29:                                               ; preds = %17
  %30 = load i64, ptr %3, align 8, !tbaa !3
  %31 = icmp eq i64 %7, %30
  %32 = getelementptr [2 x i64], ptr %3, i64 0, i64 1
  %33 = load i64, ptr %32, align 8, !tbaa !3
  %34 = icmp eq i64 %7, %33
  %35 = or i1 %31, %34
  %. = select i1 %35, i64 1, i64 -1
  %.71 = select i1 %35, i64 -1, i64 1
  %.72 = select i1 %35, ptr %2, ptr %11
  br label %36

36:                                               ; preds = %29, %17, %6
  %.sink70 = phi i64 [ -1, %6 ], [ 1, %17 ], [ %., %29 ]
  %.sink68 = phi i64 [ 1, %6 ], [ -1, %17 ], [ %.71, %29 ]
  %.sink65 = phi ptr [ %11, %6 ], [ %2, %17 ], [ %.72, %29 ]
  %37 = add i64 %10, %.sink70
  store i64 %37, ptr %9, align 8, !tbaa !3
  %38 = load i64, ptr %11, align 8, !tbaa !3
  %39 = add i64 %38, -1
  %40 = getelementptr [3 x i64], ptr %0, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !3
  %42 = add i64 %41, %.sink68
  store i64 %42, ptr %40, align 8, !tbaa !3
  %43 = load i64, ptr %.sink65, align 8, !tbaa !3
  %44 = load i64, ptr %4, align 8, !tbaa !3
  %45 = add i64 %44, -1
  %46 = getelementptr [100000 x i64], ptr %1, i64 0, i64 %45
  store i64 %43, ptr %46, align 8, !tbaa !3
  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 ptr @_FortranAioBeginExternalListOutput(i32, ptr, i32) local_unnamed_addr

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

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

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

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) }

!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"}
!7 = distinct !{!7, !8}
!8 = !{!"llvm.loop.peeled.count", i32 1}
!9 = !{!10, !10, i64 0}
!10 = !{!"descriptor member", !5, i64 0}
