g represents accelaration due to gravity G represents gravitional constant Dimensional formula for g is LT^(-2) For gravitional constant G,dimensional formula is M^(-1)L^(3)T^(-2) as mentioned above is correct. Your doubt is where did MLT^(-2) came, It is the dimensional formula of force Force =mass×accelaration That is=M×LT(-2). above mentioned dimensional formulas are correct