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

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

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