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

print((a-1 if a > b else a))
a,b=list(map(int,input().split()))

print((a-(a>b)))
a, b = list(map(int, input().split()))
print((a - 1 if a > b else a))

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

-print((a - 1 if a > b else a)) +print((a - (a > b)))