Assembly pathway of tailed bacteriophages