did u get these:
S1 = m/2 [2a + (m-1)d] --------------- #1
S2 = n/2 [2(a+md) + (n-1)d] ---------------#2
S3 = p/2 [2{a+(m+n)d} + (p-1)d] ---------------#3
if u have got these,,,
equate 1 and 2, then 1and 3 or anything ..
u get two eqns... relating the two unknowns a and d.
solve for them.
then put the valued in one of the eqns ..
u will get ans...