A uniform pencil AB of mass 4.0g can be balanced horizontally about a knife edge at 2cm from the end A when a mass of 6.0g is hang from this end. What is the length of the pencil.