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

if a <= b:

    print(a)

else:

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

if b >= a:

    ans = a

else:

    ans = a-1

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

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

-(a, b) = list(map(int, input().split())) -if a <= b: -    print(a) +a, b = list(map(int, input().split())) +if b >= a: +    ans = a -    print((a - 1)) +    ans = a - 1 +print(ans)