n,i=list(map(int,input().split()))

print((n-i+1))
print((eval(input().replace(' ', '-')) + 1))
n, i = list(map(int, input().split()))
print((n - i + 1))

print((eval(input().replace(" ", "-")) + 1))

-n, i = list(map(int, input().split())) -print((n - i + 1)) +print((eval(input().replace(" ", "-")) + 1))