Find four consecutive terms $a, b, c, d$ of an arithmetic progression and four consecutive terms $a_1,b_1,c_1,d_1$ of a geometric progression such that $a+a_1=27,b+b_1=27,c+c_1=39$, and $d+d_1=87.$ Please provide the sum of all terms in both progressions.

Let's think step by step and output the final answer within \boxed{}.
user