<gh_stars>0
# coding=utf-8

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

ans = a
if a > b:
    ans -= 1
print(ans)

# coding=utf-8

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

ans = a
if a > b:
    ans -= 1
print(ans)
# coding=utf-8