n= int(input())
print ('The next number for the number', n,'is',str(n+1)+'.')
print ('The previous number for the number',n,'is',str(n-1)+'.')
n= int(input())
print ('The next number for the number', n,'is',str(n+1)+'.')
print ('The previous number for the number',n,'is',str(n-1)+'.')