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



max = (b // a)



print((max if max < c else c))
A, B, C = list(map(int, input().split()))

print((min(B // A, C)))

a, b, c = list(map(int, input().split()))
max = b // a
print((max if max < c else c))

A, B, C = list(map(int, input().split()))
print((min(B // A, C)))

-a, b, c = list(map(int, input().split())) -max = b // a -print((max if max < c else c)) +A, B, C = list(map(int, input().split())) +print((min(B // A, C)))