      PROGRAM piyo
      IMPLICIT NONE
      integer :: a,b,i
      logical :: flaga(1:100)=.false.,flagb(1:100)=.false.
      
      read*,a,b
      
      a = a
      b = b
      
      do i = 1,100
        if( (i*108-i*100)/100 == a )then
          flaga(i) =.true.
        end if
        
        if( (i*110-i*100)/100 ==b )then
          flagb(i) = .true.
        end if
      end do
      
      do i= 1,100
        if( flaga(i).and.flagb(i) )then
          print*,i
          stop
        end if
      end do
      
      print*,'-1'
      
      
      
      
      
      
      
      END PROGRAM