hint:

Draw out 5 diagrams, one for each object and write equations linking tension and acceleration. The goal is to get 5 equations to solve for the 5 unknowns. The acceleration of all blocks must be equal.
tex2html_wrap_inline71