program main
	implicit none
    !character(4)::s
    integer::a,b,c,d,n
    read(*,*) n
    a=n/1000
    b=(n-a*1000)/100
    c=(n-a*1000 - b*100)/10
    d=(n-a*1000 -b*100 -c*10)
    if(a+b+c+d==7)then
    	write(*,'(i1,"+",i1,"+",i1,"+",i1,"=7")') a,b,c,d
    else if(a+b+c-d==7)then
    	write(*,'(i1,"+",i1,"+",i1,"-",i1,"=7")') a,b,c,d
    else if(a+b-c+d==7)then
    	write(*,'(i1,"+",i1,"-",i1,"+",i1,"=7")') a,b,c,d
    else if(a-b+c+d==7)then
    	write(*,'(i1,"-",i1,"+",i1,"+",i1,"=7")') a,b,c,d
    else if(a+b-c-d==7)then
    	write(*,'(i1,"+",i1,"-",i1,"-",i1,"=7")') a,b,c,d
    else if(a-b+c-d==7)then
    	write(*,'(i1,"-",i1,"+",i1,"-",i1,"=7")') a,b,c,d
    else if(a-b-c+d==7)then
    	write(*,'(i1,"-",i1,"-",i1,"+",i1,"=7")') a,b,c,d
    else
    	write(*,'(i1,"-",i1,"-",i1,"-",i1,"=7")') a,b,c,d
    end if
    stop
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"

@_QQcl.7f5497d772b2f1c887e5792054690145 = linkonce constant [73 x i8] c"/home/ubuntu/Downloads/TheStack_IR/Collated/Fortran/Source_6703/source.f\00"
@_QQcl.2869312C222B222C69312C222B222C69312C222B222C69312C223D372229 = linkonce constant [30 x i8] c"(i1,\22+\22,i1,\22+\22,i1,\22+\22,i1,\22=7\22)"
@_QQcl.2869312C222B222C69312C222B222C69312C222D222C69312C223D372229 = linkonce constant [30 x i8] c"(i1,\22+\22,i1,\22+\22,i1,\22-\22,i1,\22=7\22)"
@_QQcl.2869312C222B222C69312C222D222C69312C222B222C69312C223D372229 = linkonce constant [30 x i8] c"(i1,\22+\22,i1,\22-\22,i1,\22+\22,i1,\22=7\22)"
@_QQcl.2869312C222D222C69312C222B222C69312C222B222C69312C223D372229 = linkonce constant [30 x i8] c"(i1,\22-\22,i1,\22+\22,i1,\22+\22,i1,\22=7\22)"
@_QQcl.2869312C222B222C69312C222D222C69312C222D222C69312C223D372229 = linkonce constant [30 x i8] c"(i1,\22+\22,i1,\22-\22,i1,\22-\22,i1,\22=7\22)"
@_QQcl.2869312C222D222C69312C222B222C69312C222D222C69312C223D372229 = linkonce constant [30 x i8] c"(i1,\22-\22,i1,\22+\22,i1,\22-\22,i1,\22=7\22)"
@_QQcl.2869312C222D222C69312C222D222C69312C222B222C69312C223D372229 = linkonce constant [30 x i8] c"(i1,\22-\22,i1,\22-\22,i1,\22+\22,i1,\22=7\22)"
@_QQcl.2869312C222D222C69312C222D222C69312C222D222C69312C223D372229 = linkonce constant [30 x i8] c"(i1,\22-\22,i1,\22-\22,i1,\22-\22,i1,\22=7\22)"
@_QQEnvironmentDefaults = local_unnamed_addr constant ptr null

; Function Attrs: noreturn
define void @_QQmain() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = tail call ptr @_FortranAioBeginExternalListInput(i32 -1, ptr nonnull @_QQcl.7f5497d772b2f1c887e5792054690145, i32 5)
  %3 = call i1 @_FortranAioInputInteger(ptr %2, ptr nonnull %1, i32 4)
  %4 = call i32 @_FortranAioEndIoStatement(ptr %2)
  %5 = load i32, ptr %1, align 4, !tbaa !3
  %6 = sdiv i32 %5, 1000
  %.neg = mul nsw i32 %6, -1000
  %7 = add i32 %.neg, %5
  %8 = sdiv i32 %7, 100
  %.neg66 = mul nsw i32 %8, -100
  %9 = add i32 %.neg66, %7
  %10 = sdiv i32 %9, 10
  %.neg67 = mul nsw i32 %10, -10
  %11 = add i32 %.neg67, %9
  %12 = add nsw i32 %8, %6
  %13 = add nsw i32 %10, %12
  %14 = add i32 %11, %13
  %15 = icmp eq i32 %14, 7
  br i1 %15, label %38, label %16

16:                                               ; preds = %0
  %17 = sub i32 %13, %11
  %18 = icmp eq i32 %17, 7
  br i1 %18, label %38, label %19

19:                                               ; preds = %16
  %20 = sub nsw i32 %12, %10
  %21 = add i32 %11, %20
  %22 = icmp eq i32 %21, 7
  br i1 %22, label %38, label %23

23:                                               ; preds = %19
  %24 = sub nsw i32 %6, %8
  %25 = add nsw i32 %10, %24
  %26 = add i32 %11, %25
  %27 = icmp eq i32 %26, 7
  br i1 %27, label %38, label %28

28:                                               ; preds = %23
  %29 = sub i32 %20, %11
  %30 = icmp eq i32 %29, 7
  br i1 %30, label %38, label %31

31:                                               ; preds = %28
  %32 = sub i32 %25, %11
  %33 = icmp eq i32 %32, 7
  br i1 %33, label %38, label %34

34:                                               ; preds = %31
  %35 = sub nsw i32 %24, %10
  %36 = add i32 %35, %11
  %37 = icmp eq i32 %36, 7
  %. = select i1 %37, i32 23, i32 25
  %_QQcl.2869312C222D222C69312C222D222C69312C222B222C69312C223D372229._QQcl.2869312C222D222C69312C222D222C69312C222D222C69312C223D372229 = select i1 %37, ptr @_QQcl.2869312C222D222C69312C222D222C69312C222B222C69312C223D372229, ptr @_QQcl.2869312C222D222C69312C222D222C69312C222D222C69312C223D372229
  br label %38

38:                                               ; preds = %34, %31, %28, %23, %19, %16, %0
  %.sink = phi i32 [ 11, %0 ], [ 13, %16 ], [ 15, %19 ], [ 17, %23 ], [ 19, %28 ], [ 21, %31 ], [ %., %34 ]
  %_QQcl.2869312C222B222C69312C222B222C69312C222B222C69312C223D372229.sink = phi ptr [ @_QQcl.2869312C222B222C69312C222B222C69312C222B222C69312C223D372229, %0 ], [ @_QQcl.2869312C222B222C69312C222B222C69312C222D222C69312C223D372229, %16 ], [ @_QQcl.2869312C222B222C69312C222D222C69312C222B222C69312C223D372229, %19 ], [ @_QQcl.2869312C222D222C69312C222B222C69312C222B222C69312C223D372229, %23 ], [ @_QQcl.2869312C222B222C69312C222D222C69312C222D222C69312C223D372229, %28 ], [ @_QQcl.2869312C222D222C69312C222B222C69312C222D222C69312C223D372229, %31 ], [ %_QQcl.2869312C222D222C69312C222D222C69312C222B222C69312C223D372229._QQcl.2869312C222D222C69312C222D222C69312C222D222C69312C223D372229, %34 ]
  %39 = call ptr @_FortranAioBeginExternalFormattedOutput(ptr nonnull %_QQcl.2869312C222B222C69312C222B222C69312C222B222C69312C223D372229.sink, i64 30, ptr null, i32 -1, ptr nonnull @_QQcl.7f5497d772b2f1c887e5792054690145, i32 %.sink)
  %40 = call i1 @_FortranAioOutputInteger32(ptr %39, i32 %6)
  %41 = call i1 @_FortranAioOutputInteger32(ptr %39, i32 %8)
  %42 = call i1 @_FortranAioOutputInteger32(ptr %39, i32 %10)
  %43 = call i1 @_FortranAioOutputInteger32(ptr %39, i32 %11)
  %44 = call i32 @_FortranAioEndIoStatement(ptr %39)
  %45 = call {} @_FortranAStopStatement(i32 0, i1 false, i1 false)
  unreachable
}

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 @_FortranAioOutputInteger32(ptr, i32) local_unnamed_addr

declare {} @_FortranAStopStatement(i32, i1, i1) local_unnamed_addr

attributes #0 = { noreturn }

!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"}
