program main
  implicit none
  character(len=4) :: Ain
  integer :: A(4)
  integer :: ans(8)
  integer :: i
  read(*,*) Ain
  do i = 1,4
     read(Ain(i:i),*) A(i)
  end do
  ans(1) = A(1) + A(2) + A(3) + A(4)
  ans(2) = A(1) + A(2) + A(3) - A(4)
  ans(3) = A(1) + A(2) - A(3) + A(4)
  ans(4) = A(1) + A(2) - A(3) - A(4)
  ans(5) = A(1) - A(2) + A(3) + A(4)
  ans(6) = A(1) - A(2) + A(3) - A(4)
  ans(7) = A(1) - A(2) - A(3) + A(4)
  ans(8) = A(1) - A(2) - A(3) - A(4)

  do i = 1,8
     if (ans(i) == 7) then
        call output(i,a)
        stop
     end if
  end do
  stop

contains
  subroutine output(i,a)
    integer,intent(in) :: i
    integer,intent(in) :: a(4)
    select case(i)
    case(1)
       write(*,'(i0,"+",i0,"+",i0,"+",i0,"=7")') a
    case(2)
       write(*,'(i0,"+",i0,"+",i0,"-",i0,"=7")') a
    case(3)
       write(*,'(i0,"+",i0,"-",i0,"+",i0,"=7")') a
    case(4)
       write(*,'(i0,"+",i0,"-",i0,"-",i0,"=7")') a
    case(5)
       write(*,'(i0,"-",i0,"+",i0,"+",i0,"=7")') a
    case(6)
       write(*,'(i0,"-",i0,"+",i0,"-",i0,"=7")') a
    case(7)
       write(*,'(i0,"-",i0,"-",i0,"+",i0,"=7")') a
    case(8)
       write(*,'(i0,"-",i0,"-",i0,"-",i0,"=7")') a
    end select
  end subroutine output
end program main
