Two-stage laser-induced synthesis of linear carbon chains