Triangle $ABC$ satisfies $\angle ABC=\angle ACB=78^\circ$.  Points $D$ and $E$ lie on $AB,AC$ and satisfy $\angle BCD=24^\circ$ and $\angle CBE=51^\circ$.  If $\angle BED=x^\circ$, find $x$.

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