A uniform pencil AB weighing 40g can be balanced horizontally

on a knife edge at 2cm from
the end A when a mass of 60g is hung from this end. What is
the length of a pencil?