program sample
  implicit none
  integer :: a,b,c,d,abcd

  read(*,*) abcd
  a=abcd/1000
  b=abcd/100-10*a
  c=abcd/10-100*a-10*b
  d=abcd-1000*a-100*b-10*c

  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 if(a-b-c-d==7)then
     write(*,'(i1,"-",i1,"-",i1,"-",i1,"=7")') a,b,c,d
     stop
  endif
  
  stop
  
end program sample