Firstly see mutliply all values i.e. rho x g x f ,so we get kg m /m^3 s^3 see we know force had df=MLT^-2 , so we have to arrange these in such a way that it became kgm/s^2 , so rho x (g)^4 x (1/f)^6 will give the df of force, so you have to think according to situation, firstly multiply all, then take inverse to cancel power, then take power acc to situation..