The 9-th grade student Gabriel noticed a caterpillar on a tree when walking around in a forest after the classes. The caterpillar was on the height h_1 cm from the ground. On the height h_2 cm (h_2 > h_1) on the same tree hung an apple and the caterpillar was crawling to the apple.

Gabriel is interested when the caterpillar gets the apple. He noted that the caterpillar goes up by a cm per hour by day and slips down by b cm per hour by night.

In how many days Gabriel should return to the forest to see the caterpillar get the apple. You can consider that the day starts at 10 am and finishes at 10 pm. Gabriel's classes finish at 2 pm. You can consider that Gabriel noticed the caterpillar just after the classes at 2 pm.

Note that the forest is magic so the caterpillar can slip down under the ground and then lift to the apple.


-----Input-----

The first line contains two integers h_1, h_2 (1 ≤ h_1 < h_2 ≤ 10^5) — the heights of the position of the caterpillar and the apple in centimeters.

The second line contains two integers a, b (1 ≤ a, b ≤ 10^5) — the distance the caterpillar goes up by day and slips down by night, in centimeters per hour.


-----Output-----

Print the only integer k — the number of days Gabriel should wait to return to the forest and see the caterpillar getting the apple.

If the caterpillar can't get the apple print the only integer  - 1.


-----Examples-----
Input
10 30
2 1

Output
1

Input
10 13
1 1

Output
0

Input
10 19
1 2

Output
-1

Input
1 50
5 4

Output
1



-----Note-----

In the first example at 10 pm of the first day the caterpillar gets the height 26. At 10 am of the next day it slips down to the height 14. And finally at 6 pm of the same day the caterpillar gets the apple.

Note that in the last example the caterpillar was slipping down under the ground and getting the apple on the next day.

Difficulty: interview

Starter code:

Solutions:
from math import *

h1, h2 = [int(i) for i in input().split()]
a, b = [int(i) for i in input().split()]
a *= 12
b *= 12
if a <= b and h2 - h1 > (a // 12 * 8):
    print(-1)
    return
h1 += (a // 12 * 8)
if h1 >= h2:
    print(0)
    return
day = int(ceil((h2 - h1) / (a - b)))
print(day)

def solve():
    h1, h2 = list(map(int, input().split()))
    a, b = list(map(int, input().split()))

    h3 = h1 + a * 8

    if h3 >= h2:
        print(0)
        return

    if b >= a:
        print(-1)
        return

    h4 = h2 - h3

    c = (a - b) * 12

    ans = int((h4 + (c - 1)) / c)

    print(ans)


def __starting_point():
    solve()

__starting_point()

from math import ceil

h1, h2 = list(map(int, input().split()))

a, b = list(map(int, input().split()))

x = h2 - h1
p = 0

for i in range(8):
    p += a
    if p >= x:
        print(0)
        return

for i in range(100000):
    for j in range(12):
        if i&1:
            p += a
        else:
            p -= b
        if p >= x:
            print(ceil(i/2))
            return

print(-1)


#! /usr/bin/env python3
'''
' Title:	
' Author:	Cheng-Shih, Wong
' Date:		
'''

import math

h1, h2 = list(map(int, input().split()))
a, b = list(map(int, input().split()))

if h1+a*8 >= h2: print(0)
elif a <= b: print(-1)
else:
	print( math.ceil((h2-h1-8*a)/(12*(a-b))) )


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import itertools


def divceil(a, b):
    return (a + b - 1) // b


def solve(h1, h2, a, b):
    if a - b <= 0:
        return 0 if divceil(h2 - h1, a) <= 8 else -1
    h = h1
    h += a * 8
    if h >= h2:
        return 0
    h -= b * 12
    for i in itertools.count(1):
        h += a * 12
        if h >= h2:
            return i
        h -= b * 12


def main():
    h1, h2 = list(map(int, input().split()))
    a, b = list(map(int, input().split()))
    print(solve(h1, h2, a, b))


def __starting_point():
    main()

__starting_point()

line = input().split()
h1 = int(line[0])
h2 = int(line[1])
line = input().split()
a = int(line[0])
b = int(line[1])
if a <= b:
    if h1 + 8 * a >= h2:
        print(0)
    else:
        print(-1)
else:
    slips = 0
    while True:
        if h1 + 8 * a + slips * 12 * (a - b) >= h2:
            print (slips)
            break
        slips += 1


import math


h1, h2 = list(map(int, input().split()))
day, night = list(map(int, input().split()))

if h2 - h1 <= day * 8:
    print(0)
elif (h2 - h1) - day * 8 + night * 12 - day * 12 <= 0:
    print(1)
elif day - night <= 0:
    print(-1)
else:

    # (h2 - h1) <= k * (day - night) * 12 + day * 12 + day * 8 - night * 12

    print((
        int(math.ceil(
            ((h2 - h1) - day * 20 + night * 12) / ((day - night) * 12)
        )) + 1
    ))


x=input().split()
y=input().split()
dif=int(x[1])-int(x[0])
cnt=0


if dif-int(y[0])*8<=0:
	print(0)
elif int(y[0])-int(y[1])>0:
	dif=dif-int(y[0])*8+int(y[1])*12
	while dif>0:
		dif-=int(y[0])*12
		if dif<=0:
			cnt+=1
			break
		else :
			cnt+=1
			dif+=int(y[1])*12
	print(cnt)
else: print(-1)

h1, h2 = map(int, input().split())
a, b = map(int, input().split())
h1 += a * 8
if h1 >= h2:
    print(0)
else:
    h1 -= b * 12
    if b >= a:
        print(-1)
    else:
        day = 0
        while True:
            day += 1
            h1 += a * 4
            '''if h1 > h2:
                print(-1)
                break'''
            h1 += a * 8
            if h1 >= h2:
                print(day)
                break
            h1 -= b * 12

'__author__'=='deepak Singh Mehta) '

h1, h2 = list(map(int, input().split()))
a, b = list(map(int, input().split()))
h1 += a * 8
if h1 >= h2:
    print(0)
else:
    h1 -= b * 12
    if b >= a:
        print(-1)
    else:
        day = 0
        while True:
            day += 1
            h1 += a * 4
            '''if h1 > h2:
                print(-1)
                break'''
            h1 += a * 8
            if h1 >= h2:
                print(day)
                break
            h1 -= b * 12


h1, h2 = map(int, input().split(' '))
h = h2 - h1

a, b = map(int, input().split())
h -= a * 8

if h <= 0:
        print (0)
elif a <= b:
        print(-1)
else:
        print(h // (12 * (a - b)) + (1 if h % (12 * (a - b)) else 0))

h1, h2 = map(int, input().split(' '))
h = h2 - h1

a, b = map(int, input().split())
h -= a * 8

if h <= 0:
        print (0)
elif a <= b:
        print(-1)
else:
        h -= 1
        print(h // (12 * (a - b)) + 1)

ch=input()
d=ch.split()
h1=int(d[0])
h2=int(d[1])
ch=input()
d1=ch.split()
a=int(d1[0])
b=int(d1[1])
S=2
D=0
if h1<h2:
    if b>a and 8*a<(h2-h1):
        print(-1)
    elif b==a and 8*a<(h2-h1):
        print(-1)
    else:
        if  h1<h2 :
            if 8*a>=(h2-h1):
                print(0)
            else:
                h1+=a*8
                h1-=b*12
                D+=1
            while h1<h2:
                if h1+a*12>=h2:
                    break
                h1+=(a-b)*12
                D+=1
            if D!=0:
                print(D)
else:
    h1+8*a
    if a>b and 12*b<(h1-h2):
        print(-1)
    elif b==a and b*12<(8*a+h1-h2):
        print(-1)
    else:
        if  h1>h2 :
            
            if 12*b>=(h1-h2):
                print(0)
            else:
                h2+=a*12
                h2-=b*12
                D+=1
            while h1>h2:
                if h2-b*12>=h1:
                    break
                h2+=(b-a)*12
                D+=1
            if D!=0:
                print(D)
    
            
        
                
        
        


#http://codeforces.com/contest/652/problem/A


# h_cat, h_app, day_up, day_down = [map(int, input().split()), map(int,input().split())]

def dprint(str):
	pstatus = False
	if pstatus == True:
		print(str)

def check_cat():
	from math import ceil
	from operator import add
	# h_string = '10 30'
	# speed_string = '2 1'
	# h_string = '10 13'
	# speed_string = '1 1'
	# h_string = '1 50'
	# speed_string = '5 4'
	# h_string = '10 19'
	# speed_string = '1 2'
	# h_string = '1 1000'
	# speed_string = '2 1'



	h_string = input()
	speed_string = input()
	h_cat, h_app = list(map(int, h_string.split()))
	day_up, day_down = list(map(int, speed_string.split()))
	day_sub = [4*day_up, 8*day_up, -12*day_down]
	flag = False
	day_loc = [0, h_cat]
	current_pos = day_loc[1]
	day_counter = 0
	i1 = 0
	if sum(day_sub) <=0: #overall negative or zero progress
		if (h_cat + day_sub[1] >= h_app): #reach the apple in first day
			return(0)
		else:
			return(-1)
	while not flag:
		if current_pos >= h_app:
			flag = True
			break
		else:
			i1 += 1
			current_pos += day_sub[i1%3]
			day_loc.append(current_pos)
	dprint(day_loc)
	day_counter = i1
	dprint(day_counter)
	dprint(day_counter%3)

	return(int(day_counter/3))

output = check_cat()
print(output)




def main():
    a, b = list(map(int, input().split()))
    h = b - a
    a, b = list(map(int, input().split()))
    h -= a * 8
    if h <= 0:
        res = 0
    elif a <= b:
        res = -1
    else:
        a = (a - b) * 12
        res = (h + a - 1) // a
    print(res)


def __starting_point():
    main()

__starting_point()

H1, H2 = list(map(int, input().split()))
A, B = list(map(int, input().split()))

num = H2-H1-8*A
den = 12*(A-B)
if den > 0:
	ans = max(0, (num+den-1) // den)
else:
	ans = 0 if num <= 0 else -1
print(ans)


h1, h2 = list(map(int, input().split(' ')))
a, b = list(map(int, input().split(' ')))

if h1+8*a >= h2:
    print(0)
elif a <= b:
    print(-1)
else:
    cnt = 0
    h1 += 8*a
    while h1 < h2:
        h1 += 12*(a-b)
        cnt += 1
    print(cnt)


h1, h2 = list(map(int, input().split(' ')))
a, b = list(map(int, input().split(' ')))

if h1+8*a >= h2:
    print(0)
elif a <= b:
    print(-1)
else:
    dis = h2-h1-8*a
    inc = (a-b)*12
    print((dis+inc-1)//inc)


3

class StdReader:
	def read_int(self):
		return int(self.read_string())

	def read_ints(self, sep=None):
		return [int(i) for i in self.read_strings(sep)]

	def read_float(self):
		return float(self.read_string())

	def read_floats(self, sep=None):
		return [float(i) for i in self.read_strings(sep)]

	def read_string(self):
		return input()

	def read_strings(self, sep=None):
		return self.read_string().split(sep)

reader = StdReader()


def main():
	h1, h2 = reader.read_ints()
	a, b = reader.read_ints()

	if h1 + a * (22-14) >= h2:
		print(0)
		return

	if a <= b:
		print(-1)
		return

	h1 = h1 + a*(22-14)
	dh = (a-b) * 12
	# print(h1, h2, dh)

	days = (h2-h1) // dh + ((h2-h1)%dh != 0)

	print(days)


def __starting_point():
	main()

__starting_point()

h1, h2 = map(int, input().split())
a, b = map(int, input().split())
d = 0
r = h1
while(True):
    h1 += 8 * a
    if h1 >= h2:
        print(d)
        return
    d += 1
    h1 = h1 - 12 * b + 4 * a
    if d > 1 and h1 <= r:
        print("-1")
        return

h1, h2 = map(int, input().split())
a, b = map(int, input().split())
d, v = h2 - h1 - 8 * a, 12 * (a - b)
if d <= 0:
    print(0)
elif b >= a:
    print(-1)
else:
    print((d + v - 1) // v)

h1,h2 = list(map(int, input().split(" ")))
a,b = list(map(int, input().split(" ")))

def caterpillar(a,b,h1,h2):
    if h1 + 8*a >= h2:
        print(0)
    else:
        h = h1 + 8*a
        if 12*(a-b) <= 0:
            print(-1)
        else:
            c = h2-h
            d = 12*(a-b)
            print( (c // d) + (c%d > 0)*1)

caterpillar(a,b,h1,h2)


h, g = [int(x) for x in input().split(' ')]
a, b = [int(x) for x in input().split(' ')]
ans = 0
h += 8 * a
uph = h
while g > h:
    ans += 1
    h += 12 * (a - b)
    if h <= uph:
        ans = -1
        break
    uph = h
print(ans)

h, g = map(int, input().split())
a, b = map(int, input().split())
ans = 0
h += a << 3
uph = h
while g > h:
    ans += 1
    h += 12 * (a - b)
    if h <= uph:
        ans = -1
        break
    uph = h
print(ans)

def pillar():
    temp=input().split()
    bugHeight=int(temp[0])
    appleHeight=int(temp[1])
    temp=input().split()
    dayRate=int(temp[0])
    nightRate=int(temp[1])
    if(dayRate*8+bugHeight>=appleHeight):
        return 0
    else:
        bugHeight+=dayRate*8-nightRate*12
        if(bugHeight+(dayRate*12)<appleHeight and nightRate>=dayRate):
            return -1
        if(appleHeight-(bugHeight+12*dayRate)<=0):
           return 1
        temp=((appleHeight-(bugHeight+12*dayRate))/(dayRate*12.0-12*nightRate))
        if(temp==int(temp)):
              return int(temp)+1
        return int(temp)+2
    
print(pillar())