The first weight is AB the second weight is A so doing AB-A= B.
Now that you have the weight of A and B you can work out the formulae by doing the weight divided by the Ar.
A= 22g with an ar of 11
A= 22/11= 2
B=72g with an ar of 18
A2B4 and to simplify to empirical formula AB2