program answer
  implicit none

  integer :: A, B, C, D, E, i
  character linebuf*16

  read(*,*) E
  A=E/1000
  B=(E-A*1000)/100
  C=(E-A*1000-B*100)/10
  D=E-A*1000-B*100-C*10



  if(A+B+C+D==7) then
     write(*,'(i1,"+",i1,"+",i1,"+",i1,"=7")') A, B, C, D
     stop
  else if(A+B+C-D==7) then
      write(*,'(i1,"+",i1,"+",i1,"-",i1,"=7")') A, B, C, D
     stop
   else if(A+B-C+D==7) then
   write(*,'(i1,"+",i1,"-",i1,"+",i1,"=7")') A, B, C, D
      stop
   else if(A+B-C-D==7) then
       write(*,'(i1,"+",i1,"-",i1,"-",i1,"=7")') A, B, C, D
      stop
   else if(A-B+C+D==7) then
       write(*,'(i1,"-",i1,"+",i1,"+",i1,"=7")') A, B, C, D
      stop
   else if(A-B+C-D==7) then
       write(*,'(i1,"-",i1,"+",i1,"-",i1,"=7")') A, B, C, D
      stop
 else if(A-B-C+D==7) then
       write(*,'(i1,"-",i1,"-",i1,"+",i1,"=7")') A, B, C, D
      stop
   else
     write(*,'(i1,"-",i1,"-",i1,"-",i1,"=7")') A, B, C, D
   end if
   stop
  end program answer
