Since A and C are connected, their potentials are equal.
VA=VC
kqaa+kqb2a+kqc3a=kqa3a+kqb3a+kqc3a
Here qa,qb,qc are charges on A, B,C respectively.
23qa=−qb6
⇒qb=−4qa
Also as B is earthed, VB=0
kqa2a+kqb2a+kqc3a=0
3qa+3qb+2qc=0
3qa−12qa+2qc=0
⇒qc=9qa2
Finally,
qa+qc=Q
⇒qa+9qa2=Q
⇒qa=2Q11
⇒qb=−8Q11
⇒x=8