Derive the demand functions: Hotelling-style Model
You are treating the absolute value wrong. You seem to have done it right the first time around, do it like that again. (Make a little drawing, think about which side of 10 and 50 the indifferent $X_i$ will be on, etc.)

Another thing: The demand function you derived for $Q_1$ only holds for certain ranges of $P_1$, $P_2$ and $P_3$, because if the prices of firms 1 and 2 are very high but $P_3$ is low, a customer indiffirent between firms 1 and 2 would go to firm 3.