n,m=list(map(int,input().split()));print((min(m//2+n,m)//2))
n,m=list(map(int,input().split()));print(min(m/2+n,m)/2)
n, m = list(map(int, input().split()))
print((min(m // 2 + n, m) // 2))

n, m = list(map(int, input().split()))
print(min(m / 2 + n, m) / 2)

-print((min(m // 2 + n, m) // 2)) +print(min(m / 2 + n, m) / 2)