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

j=0

for v in range(n):

    j=j+1

    if (n-1)>= i:

        

        n=n-1



    else:    

        break

 

print (j)

N,i=[int(x)for x in input().split()]

x=N-i+1

print(x)

n, i = list(map(int, input().split()))
j = 0
for v in range(n):
    j = j + 1
    if (n - 1) >= i:
        n = n - 1
    else:
        break
print(j)

N, i = [int(x) for x in input().split()]
x = N - i + 1
print(x)

-n, i = list(map(int, input().split())) -j = 0 -for v in range(n): -    j = j + 1 -    if (n - 1) >= i: -        n = n - 1 -    else: -        break -print(j) +N, i = [int(x) for x in input().split()] +x = N - i + 1 +print(x)