program test
   implicit none
   integer::i,s0,su,sd,sl,sr,delE
   real::r
   do i=1,100
      call random_number(r)
      if(r<0.5) then 
         s0=1
      else
         s0=-1
      endif
      if(r<0.5) then 
         sl=1
      else
         sl=-1
      endif
      if(r<0.5) then 
         sr=1
      else
         sr=-1
      endif
      delE=2*s0*(sl+sr)
      print*,delE
   enddo
end program
