def solution(common):
x = common[2] - common[1]
y = common[2] / common[1]
answer =0
if common[2]+common[0]-common[1]==common[1]:
answer = common[len(common)-1] + x
else:
answer = common[len(common)-1] * int(y)
return answer
#common = list(map(int,input("input value::").split()))