Lifetimes of Excited States in MG i, CD i, and MG II