alan bought 3 pencils and a notebook. the notebook cost $6, and he spent a total of $12. how much did each pencil cost?