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

if n == 1:

    print((1))

else:

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

print((n - i + 1))
n, i = list(map(int, input().split()))
if n == 1:
    print((1))
else:
    print((n - i + 1))

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

-if n == 1: -    print((1)) -else: -    print((n - i + 1)) +print((n - i + 1))