program answer
  implicit none

  integer :: A, B, C, D, E, i

  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(*,*) A, '+', B, '+', C, '+', D,'=7'
     stop
  else if(A+B+C-D==7) then
     write(*,*) A, '+', B, '+', C, '-', D,'=7'
     stop
   else if(A+B-C+D==7) then
      write(*,*) A, '+', B, '-', C, '+', D,'=7'
      stop
   else if(A+B-C-D==7) then
      write(*,*) A, '+', B, '-', C, '-', D,'=7'
      stop
   else if(A-B+C+D==7) then
      write(*,*) A, '-', B, '+', C, '+', D,'=7'
      stop
   else if(A-B+C-D==7) then
      write(*,*) A, '-', B, '+', C, '-', D,'=7'
      stop
   else if(A-B-C+D==7) then
      write(*,*) A, '-', B, '-', C, '+', D,'=7'
      stop
   else
      write(*,*) A, '-', B, '-', C, '-', D,'=7'
   end if

   stop
  end program answer
