program kadai
	implicit none

	integer  ::  a,b,c
    integer  ::  flag1,flag2
    character(len=4)  ::  Q,X
    character(len=2)  ::  W
    character(len=9)  ::  Z
    flag1=0
    flag2=0
    
    read(*,*) a
    
    b=a/100
    c=a-b*100
    
    X="YYMM"
    Q="MMYY"
    Z="AMBIGUOUS"
    W="NA"
    if (0<c .and. c<13) then
    	flag1=1  !YYMM
    end if
    
    if (0<b .and. b<13) then
    	flag2=1  !MMYY
    end if
    
    if (flag1==0) then
    	if(flag2==1) then
        	write(*,'(a)') trim(Q)
        else
        	write(*,'(a)') trim(W)
        end if
    end if
    
    if (flag1==1) then
    	if(flag2==0) then
        	write(*,'(a)') trim(X)
        else
         	write(*,'(a)') trim(Z)
        end if
     end if
    
    
end program kadai
; 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.aa22a84100d0cb8ba675baeac6a43bb0 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_4276/source.f\00"
@_QQcl.59594D4D = linkonce local_unnamed_addr constant [4 x i8] c"YYMM"
@_QQcl.4D4D5959 = linkonce local_unnamed_addr constant [4 x i8] c"MMYY"
@_QQcl.414D424947554F5553 = linkonce local_unnamed_addr constant [9 x i8] c"AMBIGUOUS"
@_QQcl.4E41 = linkonce local_unnamed_addr constant [2 x i8] c"NA"
@_QQcl.286129 = linkonce constant [3 x i8] c"(a)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #0

define void @_QQmain() local_unnamed_addr {
  %1 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %2 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %3 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %4 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %5 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %6 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %7 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %8 = alloca { ptr, i64, i32, i8, i8, i8, i8 }, align 8
  %9 = alloca i32, align 4
  %10 = alloca [4 x i8], align 4
  %11 = alloca [2 x i8], align 2
  %12 = alloca [4 x i8], align 4
  %13 = alloca [9 x i8], align 1
  %14 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.aa22a84100d0cb8ba675baeac6a43bb0, i32 12)
  %15 = call i1 @_FortranAioInputInteger(ptr %14, ptr nonnull %9, i32 4)
  %16 = call i32 @_FortranAioEndIoStatement(ptr %14)
  %17 = load i32, ptr %9, align 4, !tbaa !3
  %.fr = freeze i32 %17
  %18 = srem i32 %.fr, 100
  %19 = load i32, ptr @_QQcl.59594D4D, align 1
  store i32 %19, ptr %12, align 4
  %20 = load i32, ptr @_QQcl.4D4D5959, align 1
  store i32 %20, ptr %10, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(9) %13, ptr noundef nonnull align 1 dereferenceable(9) @_QQcl.414D424947554F5553, i64 9, i1 false)
  %21 = load i16, ptr @_QQcl.4E41, align 1
  store i16 %21, ptr %11, align 2
  %22 = add nsw i32 %18, -1
  %23 = icmp ult i32 %22, 12
  %24 = add i32 %.fr, -100
  %25 = icmp ult i32 %24, 1200
  br i1 %23, label %.critedge, label %26

26:                                               ; preds = %0
  br i1 %25, label %27, label %31

27:                                               ; preds = %26
  %28 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.aa22a84100d0cb8ba675baeac6a43bb0, i32 31)
  store ptr %10, ptr %1, align 8, !tbaa !7
  %.fca.1.gep281 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep281, align 8, !tbaa !7
  %.fca.2.gep283 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep283, align 8, !tbaa !7
  %.fca.3.gep285 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep285, align 4, !tbaa !7
  %.fca.4.gep287 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep287, align 1, !tbaa !7
  %.fca.5.gep289 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep289, align 2, !tbaa !7
  %.fca.6.gep291 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %1, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep291, align 1, !tbaa !7
  %.fca.1.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %8, i64 0, i32 1
  %.fca.2.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %8, i64 0, i32 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %8, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep, align 8, !tbaa !7
  %.fca.3.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %8, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep, align 4, !tbaa !7
  %.fca.4.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %8, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep, align 1, !tbaa !7
  %.fca.5.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %8, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep, align 2, !tbaa !7
  %.fca.6.gep = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %8, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep, align 1, !tbaa !7
  %29 = call {} @_FortranATrim(ptr nonnull %8, ptr nonnull %1, ptr nonnull @_QQcl.aa22a84100d0cb8ba675baeac6a43bb0, i32 31)
  %.fca.0.load = load ptr, ptr %8, align 8, !tbaa !7
  %.fca.1.load = load i64, ptr %.fca.1.gep, align 8, !tbaa !7
  %30 = call i1 @_FortranAioOutputAscii(ptr %28, ptr %.fca.0.load, i64 %.fca.1.load)
  br label %43

31:                                               ; preds = %26
  %32 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.aa22a84100d0cb8ba675baeac6a43bb0, i32 33)
  store ptr %11, ptr %2, align 8, !tbaa !7
  %.fca.1.gep225 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 1
  store i64 2, ptr %.fca.1.gep225, align 8, !tbaa !7
  %.fca.2.gep227 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep227, align 8, !tbaa !7
  %.fca.3.gep229 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep229, align 4, !tbaa !7
  %.fca.4.gep231 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep231, align 1, !tbaa !7
  %.fca.5.gep233 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep233, align 2, !tbaa !7
  %.fca.6.gep235 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %2, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep235, align 1, !tbaa !7
  %.fca.1.gep17 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %7, i64 0, i32 1
  %.fca.2.gep19 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %7, i64 0, i32 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %7, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep19, align 8, !tbaa !7
  %.fca.3.gep21 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %7, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep21, align 4, !tbaa !7
  %.fca.4.gep23 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %7, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep23, align 1, !tbaa !7
  %.fca.5.gep25 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %7, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep25, align 2, !tbaa !7
  %.fca.6.gep27 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %7, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep27, align 1, !tbaa !7
  %33 = call {} @_FortranATrim(ptr nonnull %7, ptr nonnull %2, ptr nonnull @_QQcl.aa22a84100d0cb8ba675baeac6a43bb0, i32 33)
  %.fca.0.load29 = load ptr, ptr %7, align 8, !tbaa !7
  %.fca.1.load32 = load i64, ptr %.fca.1.gep17, align 8, !tbaa !7
  %34 = call i1 @_FortranAioOutputAscii(ptr %32, ptr %.fca.0.load29, i64 %.fca.1.load32)
  br label %43

.critedge:                                        ; preds = %0
  br i1 %25, label %39, label %35

35:                                               ; preds = %.critedge
  %36 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.aa22a84100d0cb8ba675baeac6a43bb0, i32 39)
  store ptr %12, ptr %3, align 8, !tbaa !7
  %.fca.1.gep169 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 1
  store i64 4, ptr %.fca.1.gep169, align 8, !tbaa !7
  %.fca.2.gep171 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep171, align 8, !tbaa !7
  %.fca.3.gep173 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep173, align 4, !tbaa !7
  %.fca.4.gep175 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep175, align 1, !tbaa !7
  %.fca.5.gep177 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep177, align 2, !tbaa !7
  %.fca.6.gep179 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %3, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep179, align 1, !tbaa !7
  %.fca.1.gep52 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 1
  %.fca.2.gep54 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %6, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep54, align 8, !tbaa !7
  %.fca.3.gep56 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep56, align 4, !tbaa !7
  %.fca.4.gep58 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep58, align 1, !tbaa !7
  %.fca.5.gep60 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep60, align 2, !tbaa !7
  %.fca.6.gep62 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %6, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep62, align 1, !tbaa !7
  %37 = call {} @_FortranATrim(ptr nonnull %6, ptr nonnull %3, ptr nonnull @_QQcl.aa22a84100d0cb8ba675baeac6a43bb0, i32 39)
  %.fca.0.load64 = load ptr, ptr %6, align 8, !tbaa !7
  %.fca.1.load67 = load i64, ptr %.fca.1.gep52, align 8, !tbaa !7
  %38 = call i1 @_FortranAioOutputAscii(ptr %36, ptr %.fca.0.load64, i64 %.fca.1.load67)
  br label %43

39:                                               ; preds = %.critedge
  %40 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull @_QQcl.286129, i64 3, ptr null, i32 -1, ptr nonnull @_QQcl.aa22a84100d0cb8ba675baeac6a43bb0, i32 41)
  store ptr %13, ptr %4, align 8, !tbaa !7
  %.fca.1.gep122 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 1
  store i64 9, ptr %.fca.1.gep122, align 8, !tbaa !7
  %.fca.2.gep124 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 2
  store i32 20180515, ptr %.fca.2.gep124, align 8, !tbaa !7
  %.fca.3.gep126 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep126, align 4, !tbaa !7
  %.fca.4.gep128 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep128, align 1, !tbaa !7
  %.fca.5.gep130 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 5
  store i8 0, ptr %.fca.5.gep130, align 2, !tbaa !7
  %.fca.6.gep132 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %4, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep132, align 1, !tbaa !7
  %.fca.1.gep87 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 1
  %.fca.2.gep89 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %5, i8 0, i64 16, i1 false)
  store i32 20180515, ptr %.fca.2.gep89, align 8, !tbaa !7
  %.fca.3.gep91 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 3
  store i8 0, ptr %.fca.3.gep91, align 4, !tbaa !7
  %.fca.4.gep93 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 4
  store i8 40, ptr %.fca.4.gep93, align 1, !tbaa !7
  %.fca.5.gep95 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 5
  store i8 2, ptr %.fca.5.gep95, align 2, !tbaa !7
  %.fca.6.gep97 = getelementptr inbounds { ptr, i64, i32, i8, i8, i8, i8 }, ptr %5, i64 0, i32 6
  store i8 0, ptr %.fca.6.gep97, align 1, !tbaa !7
  %41 = call {} @_FortranATrim(ptr nonnull %5, ptr nonnull %4, ptr nonnull @_QQcl.aa22a84100d0cb8ba675baeac6a43bb0, i32 41)
  %.fca.0.load99 = load ptr, ptr %5, align 8, !tbaa !7
  %.fca.1.load102 = load i64, ptr %.fca.1.gep87, align 8, !tbaa !7
  %42 = call i1 @_FortranAioOutputAscii(ptr %40, ptr %.fca.0.load99, i64 %.fca.1.load102)
  br label %43

43:                                               ; preds = %31, %27, %35, %39
  %.fca.0.load29.sink = phi ptr [ %.fca.0.load29, %31 ], [ %.fca.0.load, %27 ], [ %.fca.0.load64, %35 ], [ %.fca.0.load99, %39 ]
  %.sink = phi ptr [ %32, %31 ], [ %28, %27 ], [ %36, %35 ], [ %40, %39 ]
  call void @free(ptr %.fca.0.load29.sink)
  %44 = call i32 @_FortranAioEndIoStatement(ptr %.sink)
  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 @_FortranAioBeginExternalFormattedOutput(ptr, i64, ptr, i32, ptr, i32) local_unnamed_addr

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

declare {} @_FortranATrim(ptr, ptr, ptr, i32) local_unnamed_addr

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

attributes #0 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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 = !{!8, !8, i64 0}
!8 = !{!"descriptor member", !5, i64 0}
