g=lambda a:a>[]and g([i-j for i,j in zip(a[1:],a)])+a[-1] while 1:print g(map(int,raw_input().split()))